Guest User

Untitled

a guest
Oct 18th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. //Attribute des Selectors
  2.     private int index;
  3.     private JButton[] netz;
  4.     private JButton auswahl;
  5.  
  6.    
  7.     //Konstruktor
  8.     public ButtonSelector(int index) {
  9.        
  10.         this.netz = new JButton[9];
  11.         this.auswahl = new JButton();
  12.        
  13.         this.index = index;
  14.        
  15.         for (int i = 0; i < netz.length; i++) {
  16.             //Erstellen der Buttons und setzen des Textes
  17.             this.netz[i] = new JButton(Integer.toString(i + 1));
  18.  
  19.             this.netz[i].setSelected(false);
  20.             this.netz[i].setEnabled(true);
  21.             this.auswahl.setSelected(false);
  22.  
  23.             this.netz[i].setName(Integer.toString(this.index) + "."
  24.                     + Integer.toString(i + 1));
  25.         }
  26.  
  27.         this.auswahl.setName(Integer.toString(this.index) + ".selection");
  28.        
  29.     }
Add Comment
Please, Sign In to add comment