src/de/uapcore/sudoku/ButtonPanel.java

Sat, 26 Jan 2013 17:42:07 +0100

author
Mike Becker <universe@uap-core.de>
date
Sat, 26 Jan 2013 17:42:07 +0100
changeset 2
5179eff8a9b6
child 3
ed931970b4ac
permissions
-rw-r--r--

check functions

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