-
Bug
-
Resolution: Fixed
-
P4
-
7
-
b48
-
x86
-
linux
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2199379 | OpenJDK6 | Artem Ananiev | P3 | Resolved | Fixed | b21 |
FULL PRODUCT VERSION :
openjdk version "1.6.0-internal"
OpenJDK Runtime Environment (build 1.6.0-internal-langel_02_jun_2008_10_58-b00)
OpenJDK Server VM (build 10.0-b19, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux towel.yyz.redhat.com 2.6.25-14.fc9.i686 #1 SMP Thu May 1 06:28:41 EDT 2008 i686 i686 i386 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
The pack() method of the Window class allow to resize the window based on the
contents preferred sizes, when using OpenJDK on the following example, the
window always have a empty area below (that does not happens of the Sun Java
binaries)
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
public class TestFrame {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel(new FlowLayout());
panel.add(new JButton("Testing..."));
frame.setContentPane(panel);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the test case
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Window should be framed around the center button
ACTUAL -
Window is longer than it should be. size calculated wrong
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
public class TestFrame {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel(new FlowLayout());
panel.add(new JButton("Testing..."));
frame.setContentPane(panel);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}
---------- END SOURCE ----------
openjdk version "1.6.0-internal"
OpenJDK Runtime Environment (build 1.6.0-internal-langel_02_jun_2008_10_58-b00)
OpenJDK Server VM (build 10.0-b19, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux towel.yyz.redhat.com 2.6.25-14.fc9.i686 #1 SMP Thu May 1 06:28:41 EDT 2008 i686 i686 i386 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
The pack() method of the Window class allow to resize the window based on the
contents preferred sizes, when using OpenJDK on the following example, the
window always have a empty area below (that does not happens of the Sun Java
binaries)
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
public class TestFrame {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel(new FlowLayout());
panel.add(new JButton("Testing..."));
frame.setContentPane(panel);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the test case
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Window should be framed around the center button
ACTUAL -
Window is longer than it should be. size calculated wrong
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
public class TestFrame {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel(new FlowLayout());
panel.add(new JButton("Testing..."));
frame.setContentPane(panel);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}
---------- END SOURCE ----------
- backported by
-
JDK-2199379 Bad window size calculation after using pack()
-
- Resolved
-
- relates to
-
JDK-6848424 java/awt/Frame/FrameSize/TestFrameSize.java needs improvement
-
- Resolved
-