Name: skT45625 Date: 08/09/2000
Solaris VM (build Solaris_JDK_1.2_01, native threads, sunwjit)
Hi, the documentation for BorderLayout says:
"A border layout lays out a container, arranging and resizing
its components to fit in five regions: north, south, east,west, and center"
I read it as "multiple components can be put into a single
region". Yet, apparently the borderLayout can only handle
5 components (one per region). Here is a sample code
public class LayoutTest extends Frame {
public LayoutTest() {
super("test");
setLayout(new BorderLayout());
add(new Button("North"), BorderLayout.NORTH);
add(new Button("South"), BorderLayout.SOUTH);
add(new Button("East"), BorderLayout.EAST);
add(new Button("East2"), BorderLayout.EAST);
add(new Button("West"), BorderLayout.WEST);
add(new Button("Center"), BorderLayout.CENTER);
}
public static void main(String[] args)
{
LayoutTest lt=new LayoutTest();
lt.setSize(300,300);
lt.setVisible(true);
}
}
Only the "East2" button appears in the frame.
This is either a bug or a misleading documentation..
Have I missed something?
Thanks,
Ilya
###@###.###
(Review ID: 108138)
======================================================================