-
Bug
-
Resolution: Unresolved
-
P4
-
5.0
-
Cause Known
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Creating a JFrame with a FlowLayout set on it; then adding a number of components that might wrap into 2 rows, if the Java look and feel decorations are turned on (as happens by invoking setDefaultLookAndFeelDecorated(true)), then the resulting Frame will size to display all the components in one complete row but will not resize smaller than this width. If the frame is maximized, the components /will/ wrap into 2 or more rows but when restored it is restricted.
Using the same code and removing the setLookAndFeelDecorated hint yields a frame in the OS look and feel which /will/ resize to an arbitrary width and wrap the components onto 2 or more rows.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute the test code and attempt to resize the width of the frame smaller.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
As happens when the line:
setDefaultLookAndFeelDecorated(true);
is removed.
ACTUAL -
A too-wide frame that can't be shrunk.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Scratch {
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame f = new JFrame();
f.setLayout(new FlowLayout());
for (int i = 1; i < 20; i++) {
f.add(new JButton("JButton Number " + i));
}
f.pack();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Do not use the Java Look and Feel decorations.
###@###.### 2004-12-06 08:59:13 GMT
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Creating a JFrame with a FlowLayout set on it; then adding a number of components that might wrap into 2 rows, if the Java look and feel decorations are turned on (as happens by invoking setDefaultLookAndFeelDecorated(true)), then the resulting Frame will size to display all the components in one complete row but will not resize smaller than this width. If the frame is maximized, the components /will/ wrap into 2 or more rows but when restored it is restricted.
Using the same code and removing the setLookAndFeelDecorated hint yields a frame in the OS look and feel which /will/ resize to an arbitrary width and wrap the components onto 2 or more rows.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute the test code and attempt to resize the width of the frame smaller.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
As happens when the line:
setDefaultLookAndFeelDecorated(true);
is removed.
ACTUAL -
A too-wide frame that can't be shrunk.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Scratch {
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame f = new JFrame();
f.setLayout(new FlowLayout());
for (int i = 1; i < 20; i++) {
f.add(new JButton("JButton Number " + i));
}
f.pack();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Do not use the Java Look and Feel decorations.
###@###.### 2004-12-06 08:59:13 GMT