import javax.swing.*; public class JButtonGridExample { public static void main(String[] args) { try { UIManager.setLookAndFeel( UIManager.getCrossPlatformLookAndFeelClassName() ); } catch (Exception e) { System.exit(1); } JFrame vindu = new JFrame("Testing JButtonGrid"); vindu.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JButtonGrid grid = new JButtonGrid(10, 18, 30); vindu.add(grid); vindu.pack(); vindu.setLocationRelativeTo(null); vindu.setVisible(true); } }