-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1.2
-
None
-
sparc
-
generic
When placing a Choice component into a GridLayout layout manager, the Choice component does not fill the entire cell it is allocated in the GridLayout. This is contrary to what the Java tutorial (p. 423) says. I can't find a definite answer on how the GridLayout should work, other than in the tutorial.
When placing a button inside a GridLayout, it occupies the full cell.
The problem occurs with JDK 1.1, 1.1.1, and 1.1.2.
--------------------------------------------------------------------------------
Application to reproduce the problem:
import java.awt.*;
import java.awt.event.*;
public class GridChoiceBug extends Frame implements WindowListener
{
Choice c1;
public GridChoiceBug()
{
super("Test Dialog Layout Manager");
addNotify();
Insets insets = getInsets();
setSize( insets.left + 400 + insets.right, insets.top + 400 +
insets.bottom );
setLayout(new GridLayout(1,1));
c1 = new Choice();
c1.addItem("One");
add( c1 );
addWindowListener(this);
validate();
show();
}
public void windowClosed(WindowEvent event) {}
public void windowDeiconified(WindowEvent event) {}
public void windowIconified(WindowEvent event) {}
public void windowActivated(WindowEvent event) {}
public void windowDeactivated(WindowEvent event) {}
public void windowOpened(WindowEvent event) {}
public void windowClosing(WindowEvent event)
{
System.exit(0);
}
public static void main(String args[])
{
new GridChoiceBug();
}
}
creighton.chong@eng 1997-11-21
When placing a button inside a GridLayout, it occupies the full cell.
The problem occurs with JDK 1.1, 1.1.1, and 1.1.2.
--------------------------------------------------------------------------------
Application to reproduce the problem:
import java.awt.*;
import java.awt.event.*;
public class GridChoiceBug extends Frame implements WindowListener
{
Choice c1;
public GridChoiceBug()
{
super("Test Dialog Layout Manager");
addNotify();
Insets insets = getInsets();
setSize( insets.left + 400 + insets.right, insets.top + 400 +
insets.bottom );
setLayout(new GridLayout(1,1));
c1 = new Choice();
c1.addItem("One");
add( c1 );
addWindowListener(this);
validate();
show();
}
public void windowClosed(WindowEvent event) {}
public void windowDeiconified(WindowEvent event) {}
public void windowIconified(WindowEvent event) {}
public void windowActivated(WindowEvent event) {}
public void windowDeactivated(WindowEvent event) {}
public void windowOpened(WindowEvent event) {}
public void windowClosing(WindowEvent event)
{
System.exit(0);
}
public static void main(String args[])
{
new GridChoiceBug();
}
}
creighton.chong@eng 1997-11-21
- duplicates
-
JDK-4032771 Solaris: setSize doesn't change the size of Choice
- Closed