-
Bug
-
Resolution: Duplicate
-
P5
-
None
-
1.4.1
-
x86
-
windows_2000
Name: jk109818 Date: 03/17/2003
FULL PRODUCT VERSION :
java version "1.4.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
FULL OS VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
BoxLayout sizes components incorrectly.
As can be seen components end up being xAlignment * preferred size shorter than they are meant to be.
(Related to bug id: 4140481)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run code
EXPECTED VERSUS ACTUAL BEHAVIOR :
components to have their preferred widths
components are xAlignment * their preferred widths shorter than their preferred widths
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container contentPane = frame.getContentPane();
contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
JTree tree = new JTree();
tree.setAlignmentX(0.1f);
contentPane.add(tree);
tree = new JTree();
tree.setAlignmentX(0.5f);
contentPane.add(tree);
tree = new JTree();
tree.setAlignmentX(0.9f);
contentPane.add(tree);
frame.pack();
frame.setVisible(true);
}
}
---------- END SOURCE ----------
(Review ID: 182028)
======================================================================
FULL PRODUCT VERSION :
java version "1.4.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
FULL OS VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
BoxLayout sizes components incorrectly.
As can be seen components end up being xAlignment * preferred size shorter than they are meant to be.
(Related to bug id: 4140481)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run code
EXPECTED VERSUS ACTUAL BEHAVIOR :
components to have their preferred widths
components are xAlignment * their preferred widths shorter than their preferred widths
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container contentPane = frame.getContentPane();
contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
JTree tree = new JTree();
tree.setAlignmentX(0.1f);
contentPane.add(tree);
tree = new JTree();
tree.setAlignmentX(0.5f);
contentPane.add(tree);
tree = new JTree();
tree.setAlignmentX(0.9f);
contentPane.add(tree);
frame.pack();
frame.setVisible(true);
}
}
---------- END SOURCE ----------
(Review ID: 182028)
======================================================================
- duplicates
-
JDK-6893839 BoxLayout uses invalid Layout Information
-
- Closed
-