Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Attribute des Selectors
- private int index;
- private JButton[] netz;
- private JButton auswahl;
- //Konstruktor
- public ButtonSelector(int index) {
- this.netz = new JButton[9];
- this.auswahl = new JButton();
- this.index = index;
- for (int i = 0; i < netz.length; i++) {
- //Erstellen der Buttons und setzen des Textes
- this.netz[i] = new JButton(Integer.toString(i + 1));
- this.netz[i].setSelected(false);
- this.netz[i].setEnabled(true);
- this.auswahl.setSelected(false);
- this.netz[i].setName(Integer.toString(this.index) + "."
- + Integer.toString(i + 1));
- }
- this.auswahl.setName(Integer.toString(this.index) + ".selection");
- }
Add Comment
Please, Sign In to add comment