9 |
9 |
10 /** |
10 /** |
11 * |
11 * |
12 * @author mike |
12 * @author mike |
13 */ |
13 */ |
14 public class Sudoku extends JFrame { |
14 public final class Sudoku extends JFrame { |
15 |
15 |
16 public Sudoku() { |
16 public Sudoku() { |
17 super("Sudoku"); |
17 super("Sudoku"); |
|
18 |
|
19 Field f = new Field(); |
|
20 ActionHandler h = new ActionHandler(f); |
18 |
21 |
19 JRootPane root = getRootPane(); |
22 JRootPane root = getRootPane(); |
20 |
23 |
21 root.setLayout(new GridBagLayout()); |
24 root.setLayout(new GridBagLayout()); |
22 GridBagConstraints c = new GridBagConstraints(); |
25 GridBagConstraints c = new GridBagConstraints(); |
23 c.insets = new Insets(20, 20, 20, 20); |
26 c.insets = new Insets(20, 20, 20, 20); |
|
27 c.fill = GridBagConstraints.HORIZONTAL; |
24 |
28 |
25 c.gridx = 0; c.gridy = 0; |
29 c.gridx = 0; c.gridy = 0; |
26 root.add(new Field(), c); |
30 root.add(f, c); |
|
31 c.gridy++; |
|
32 root.add(new ButtonPanel(h), c); |
27 |
33 |
28 pack(); |
34 pack(); |
29 root.setBackground(Color.WHITE); |
35 root.setBackground(Color.WHITE); |
30 setLocationByPlatform(true); |
36 setLocationByPlatform(true); |
31 setDefaultCloseOperation(EXIT_ON_CLOSE); |
37 setDefaultCloseOperation(EXIT_ON_CLOSE); |