-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1.7
-
x86
-
windows_nt
On win32 with JDK 1.1.7E, when a JFrame uses a BorderLayout and adds JPanels, the JFrame fails to display properly when it is minimized and restored.
In the test case below, the center JPanel is shifted downwards and to the left.
The right JPanel is partially removed, and the bottom JPanel is no longer visible.
Resizing the JFrame causes the JPanels to be displayed properly.
This behavior is a regression from the 1.1.6 functionality.
---------------------------------- BuggyFrame.java -----------------------------
import java.awt.*;
import java.awt.event.*;
import com.sun.java.swing.*;
class BuggyFrame extends JFrame {
BuggyFrame() {
super("BuggyFrame");
}
public static void main(String args[]) {
BuggyFrame frame = new BuggyFrame();
frame.getContentPane().setLayout(new BorderLayout());
JPanel centerPanel = new JPanel();
centerPanel.setBackground(Color.white);
frame.getContentPane().add("Center", centerPanel);
JPanel rightPanel = new JPanel();
rightPanel.setBackground(Color.red);
frame.getContentPane().add("East", rightPanel);
JPanel bottomPanel = new JPanel();
bottomPanel.setBackground(Color.black);
frame.getContentPane().add("South", bottomPanel);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
frame.pack();
frame.setSize(500, 600);
frame.show();
}
}
In the test case below, the center JPanel is shifted downwards and to the left.
The right JPanel is partially removed, and the bottom JPanel is no longer visible.
Resizing the JFrame causes the JPanels to be displayed properly.
This behavior is a regression from the 1.1.6 functionality.
---------------------------------- BuggyFrame.java -----------------------------
import java.awt.*;
import java.awt.event.*;
import com.sun.java.swing.*;
class BuggyFrame extends JFrame {
BuggyFrame() {
super("BuggyFrame");
}
public static void main(String args[]) {
BuggyFrame frame = new BuggyFrame();
frame.getContentPane().setLayout(new BorderLayout());
JPanel centerPanel = new JPanel();
centerPanel.setBackground(Color.white);
frame.getContentPane().add("Center", centerPanel);
JPanel rightPanel = new JPanel();
rightPanel.setBackground(Color.red);
frame.getContentPane().add("East", rightPanel);
JPanel bottomPanel = new JPanel();
bottomPanel.setBackground(Color.black);
frame.getContentPane().add("South", bottomPanel);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
frame.pack();
frame.setSize(500, 600);
frame.show();
}
}
- duplicates
-
JDK-4167248 Contents of JFrame mis-aligned when minimized/maximized
- Closed