Nęste |
|
Swing'it! serie, Planche nr. 9 |
![]() |
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);