package gui; import java.awt.*; // nested GridLayout Manager public class Farbwahl2 { public Farbwahl2() { frame1.setLayout(new GridLayout(3,3)); for (int i=0;i<9;i++) { p[i] = new Panel(new GridLayout(5,1)); } // for b[0] = new Button("rot"); b[1] = new Button("blau"); b[2] = new Button("gruen"); b[3] = new Button("gelb"); b[4] = new Button("schwarz"); for (int i=0;i<5;i++) { p[4].add(b[i]); } // for for (int i=0;i<9;i++) { frame1.add(p[i]); } // for frame1.setTitle("Farbwahl, Version 2"); frame1.setSize(300,300); frame1.setVisible(true); // frame1.show(); deprecated } // Farbwahl2() public static void main(String[] args) { Farbwahl2 f2 = new Farbwahl2(); } // main private Frame1 frame1 = new Frame1(); private Panel[] p = new Panel[9]; private Button[] b = new Button[5]; } // Farbwahl2