-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
7
-
x86
-
windows_7
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2221199 | 7u6 | Pavel Porvatov | P3 | Closed | Cannot Reproduce |
FULL PRODUCT VERSION :
JDK 1.7.0 b134
ADDITIONAL OS VERSION INFORMATION :
Windows 7 Ultimate x86, fully patched
A DESCRIPTION OF THE PROBLEM :
The sample program produces strange drawing results when the frame is snapped vertically via the Windows 7 Aero's snap feature. The reason seems to be that when the snap occurs, the corresponding componentResized event never reaches the JFrame, therefore, the layout cannot accomodate the changes.
The same program works with 1.6.0_24
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the program.
Move it close to the top or bottom of the screen.
Resize the window and accept the Windows 7 snap suggestion to make it vertically maximized.
Observer the border mispaint and the lack of stdout report of a resize event
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The snapped size appears in the console, the border is painted full-window sized.
ACTUAL -
No resize event occurs.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class SnapBug extends JFrame {
public SnapBug() {
super("Snap bug");
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
JPanel p = new JPanel();
p.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
p.setPreferredSize(new Dimension(640, 480));
p.setBackground(Color.GREEN);
getContentPane().add(p, BorderLayout.CENTER);
addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent e) {
System.out.printf("%d x %d%n", getWidth(), getHeight());
}
});
pack();
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
SnapBug b = new SnapBug();
b.setVisible(true);
}
});
}
}
---------- END SOURCE ----------
JDK 1.7.0 b134
ADDITIONAL OS VERSION INFORMATION :
Windows 7 Ultimate x86, fully patched
A DESCRIPTION OF THE PROBLEM :
The sample program produces strange drawing results when the frame is snapped vertically via the Windows 7 Aero's snap feature. The reason seems to be that when the snap occurs, the corresponding componentResized event never reaches the JFrame, therefore, the layout cannot accomodate the changes.
The same program works with 1.6.0_24
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the program.
Move it close to the top or bottom of the screen.
Resize the window and accept the Windows 7 snap suggestion to make it vertically maximized.
Observer the border mispaint and the lack of stdout report of a resize event
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The snapped size appears in the console, the border is painted full-window sized.
ACTUAL -
No resize event occurs.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class SnapBug extends JFrame {
public SnapBug() {
super("Snap bug");
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
JPanel p = new JPanel();
p.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
p.setPreferredSize(new Dimension(640, 480));
p.setBackground(Color.GREEN);
getContentPane().add(p, BorderLayout.CENTER);
addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent e) {
System.out.printf("%d x %d%n", getWidth(), getHeight());
}
});
pack();
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
SnapBug b = new SnapBug();
b.setVisible(true);
}
});
}
}
---------- END SOURCE ----------
- backported by
-
JDK-2221199 componentResized not called when the form is snapped
-
- Closed
-
- relates to
-
JDK-7166305 JFrame is not validated on resizing in height by Windows Aero Snap
-
- Closed
-