Sat, 26 Jan 2013 17:42:07 +0100
check functions
universe@2 | 1 | package de.uapcore.sudoku; |
universe@2 | 2 | |
universe@2 | 3 | import java.awt.Color; |
universe@2 | 4 | import java.awt.GridBagConstraints; |
universe@2 | 5 | import java.awt.GridBagLayout; |
universe@2 | 6 | import java.awt.Insets; |
universe@2 | 7 | import javax.swing.JButton; |
universe@2 | 8 | import javax.swing.JPanel; |
universe@2 | 9 | |
universe@2 | 10 | /** |
universe@2 | 11 | * |
universe@2 | 12 | * @author mike |
universe@2 | 13 | */ |
universe@2 | 14 | public final class ButtonPanel extends JPanel { |
universe@2 | 15 | |
universe@2 | 16 | private JButton save, check, solve; |
universe@2 | 17 | |
universe@2 | 18 | public ButtonPanel(ActionHandler l) { |
universe@2 | 19 | setLayout(new GridBagLayout()); |
universe@2 | 20 | |
universe@2 | 21 | GridBagConstraints c = new GridBagConstraints(); |
universe@2 | 22 | c.insets = new Insets(10, 10, 10, 10); |
universe@2 | 23 | c.fill = GridBagConstraints.HORIZONTAL; |
universe@2 | 24 | c.weightx = 1; |
universe@2 | 25 | |
universe@2 | 26 | c.gridx = 0; |
universe@2 | 27 | c.gridy = 0; |
universe@2 | 28 | save = new JButton("Speichern"); |
universe@2 | 29 | add(save, c); |
universe@2 | 30 | c.gridx++; |
universe@2 | 31 | check = new JButton("Prüfen"); |
universe@2 | 32 | add(check, c); |
universe@2 | 33 | solve = new JButton("Lösen"); |
universe@2 | 34 | c.gridx++; |
universe@2 | 35 | add(solve, c); |
universe@2 | 36 | |
universe@2 | 37 | save.setActionCommand(ActionHandler.SAVE); |
universe@2 | 38 | save.addActionListener(l); |
universe@2 | 39 | check.setActionCommand(ActionHandler.CHECK); |
universe@2 | 40 | check.addActionListener(l); |
universe@2 | 41 | solve.setActionCommand(ActionHandler.SOLVE); |
universe@2 | 42 | solve.addActionListener(l); |
universe@2 | 43 | |
universe@2 | 44 | setBackground(Color.WHITE); |
universe@2 | 45 | } |
universe@2 | 46 | } |