src/de/uapcore/sudoku/ButtonPanel.java

changeset 2
5179eff8a9b6
child 3
ed931970b4ac
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/de/uapcore/sudoku/ButtonPanel.java	Sat Jan 26 17:42:07 2013 +0100
@@ -0,0 +1,46 @@
+package de.uapcore.sudoku;
+
+import java.awt.Color;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+/**
+ *
+ * @author mike
+ */
+public final class ButtonPanel extends JPanel {
+    
+    private JButton save, check, solve;
+
+    public ButtonPanel(ActionHandler l) {
+        setLayout(new GridBagLayout());
+        
+        GridBagConstraints c = new GridBagConstraints();
+        c.insets = new Insets(10, 10, 10, 10);
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.weightx = 1;
+        
+        c.gridx = 0;
+        c.gridy = 0;
+        save = new JButton("Speichern");
+        add(save, c);
+        c.gridx++;
+        check = new JButton("Prüfen");
+        add(check, c);
+        solve = new JButton("Lösen");
+        c.gridx++;
+        add(solve, c);
+        
+        save.setActionCommand(ActionHandler.SAVE);
+        save.addActionListener(l);
+        check.setActionCommand(ActionHandler.CHECK);
+        check.addActionListener(l);
+        solve.setActionCommand(ActionHandler.SOLVE);
+        solve.addActionListener(l);
+        
+        setBackground(Color.WHITE);
+    }
+}

mercurial