import java.awt.*; import java.awt.event.*; /*Beispiel zur Demonstration des Flow-Layouts*/ public class FlowDemoParameter extends Frame { private static final long serialVersionUID = 1L; public FlowDemoParameter (String Title, String Layout) { super (Title); int L = 0; try { L = Integer.parseInt(Layout); } catch (Exception e) { } setLayout (new FlowLayout (L)); setSize (200, 150); for (int i = 1; i<= 7; i++) { String s = " "; for (int j = 0; j < i; j++) s += "x"; //Jeder weitere Button im FlowLayout wird mit x aufgefüllt add (new Button (s)); } addWindowListener (new WindowAdapter() { public void windowClosing (WindowEvent event) { System.exit(0); } }); setVisible (true); } public static void main(String[] args) { new FlowDemoParameter ("FlowLayout", args[0]); } }