import java.awt.*; public class AppWithPanel { Frame f = new Frame ("first application"); public AppWithPanel() { f.setLayout(new FlowLayout()); f.setSize(330, 330); Panel p1 = new Panel(); p1.setLayout(new FlowLayout()); Button b1 = new Button("button1"); Button b2 = new Button("button2"); b1.setEnabled(false); p1.add(b1); p1.add(b2); f.add(p1); Panel p2 = new Panel(); Label l = new Label ("my first label"); p2.add (l); f.add(p2); TextField tf = new TextField(20); TextArea ta = new TextArea(10,20); f.add(tf); f.add(ta); Choice c = new Choice(); c.add("sunday"); c.add("monday"); // ... c.add("saturday"); f.add(c); List list = new List(); list.add("one"); list.add("two"); // ... list.add("zero"); f.add(list); Panel p3 = new Panel(); checkbox(p3); f.add(p3); f.setVisible(true); } void checkbox(Container con) { con.setLayout(new GridLayout(0,2)); con.add(new Label("checkboxes")); CheckboxGroup cbg = new CheckboxGroup(); Checkbox cb1 = new Checkbox("Checkbox 1"); Checkbox cb2 = new Checkbox("Checkbox 2",cbg,true); Checkbox cb3 = new Checkbox("Checkbox 3",cbg,false); con.add(cb1); con.add(cb2); con.add(cb3); } public static void main (String[] args) { AppWithPanel app = new AppWithPanel(); } }