Construct the object including its GUI
setTitle("FrameDemo");
Panel top_frame = new Panel();
top_frame.add(new Label("User"));
top_frame.add(new TextField(10));
top_frame.add(new Label("Password"));
top_frame.add(new TextField(10));
add("North", top_frame);
Panel bottom_frame = new Panel();
bottom_frame.add(new Button("OK"));
bottom_frame.add(new Button("Cancel"));
add("South", bottom_frame);
pack();