BorderLayout
The same applet may be invoked within a smaller region without changing the applet:
Corrsponding source code:
import java.awt.*;
import java.applet.Applet;
public class BorderLayoutTest extends Applet {
public void init() {
setLayout(new BorderLayout());
add("North", new Label("A Header Maybe"));
add("South",new TextField("Type some text here"));
add("West",new Button("QUIT"));
add("East", new Button("HELP"));
add("Center",new TextArea("Some random text\nin a TextArea"));
}
}
See also How to Use BorderLayout.
Related Magercise(s):