Help is available for each task.
Task 1
Create a
Panel
managed by BorderLayout
. Add a Label
"Name:
"
to the west region and a TextField
to the center region.
Panel p = new Panel(new BorderLayout());
Label nameLabel = new Label("Name:");
TextField entry = new TextField();
p.add(nameLabel, BorderLayout.WEST);
p.add(entry, BorderLayout.CENTER);
Task 2
Set the layout of the applet to
BorderLayout
. Add the Panel
you just created to the north region of the applet container.
setLayout(new BorderLayout());
add(p, BorderLayout.NORTH);
Copyright © 1998-1999
MageLang Institute.
All Rights Reserved.