Nęste
Forrige
Oversigt
Swing'it! serie, Planche nr. 9
Kursus Indhold

Swing-programmering



//Set up the JPanel, which contains the text field and list.
JPanel panel = new JPanel();
panel.setLayout(new SomeLayoutManager());
panel.add(textField);
panel.add(list);

//topLevel is an instance of JApplet or JFrame
Container contentPane = topLevel.getContentPane();
contentPane.setLayout(new AnotherLayoutManager());
contentPane.add(button1);
contentPane.add(button2);
contentPane.add(panel);


© 1998 BLA*net - Leif E. Andersen, leander@blanet.dk