-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
None
-
6
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.6.0_05-ea"
Java(TM) SE Runtime Environment (build 1.6.0_05-ea-b05)
Java HotSpot(TM) Client VM (build 1.6.0_05-ea-b05, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Initial setting the maximized state of JFrame does still not work, if the content pane is set or a component is added to the content pane.
This bug report is similar to bug report Id 4464714, except the setting of the content pane.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run example source code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The frame should appear in maximized state.
ACTUAL -
The frame appears in normal state.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class Maxim extends JFrame {
public Maxim() {
super();
JPanel content =new JPanel();
setContentPane(content);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setExtendedState(MAXIMIZED_BOTH);
}
public static void main(String args[]){
// thread safe packing
Runnable show = new Runnable() {
public void run() {
Maxim mf = new Maxim();
mf.pack();
mf.setVisible(true);
//mf.setExtendedState(MAXIMIZED_BOTH);
}
};
SwingUtilities.invokeLater(show);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Call setExtendedState(MAXIMIZED_BOTH) after showing the frame.
java version "1.6.0_05-ea"
Java(TM) SE Runtime Environment (build 1.6.0_05-ea-b05)
Java HotSpot(TM) Client VM (build 1.6.0_05-ea-b05, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Initial setting the maximized state of JFrame does still not work, if the content pane is set or a component is added to the content pane.
This bug report is similar to bug report Id 4464714, except the setting of the content pane.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run example source code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The frame should appear in maximized state.
ACTUAL -
The frame appears in normal state.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class Maxim extends JFrame {
public Maxim() {
super();
JPanel content =new JPanel();
setContentPane(content);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setExtendedState(MAXIMIZED_BOTH);
}
public static void main(String args[]){
// thread safe packing
Runnable show = new Runnable() {
public void run() {
Maxim mf = new Maxim();
mf.pack();
mf.setVisible(true);
//mf.setExtendedState(MAXIMIZED_BOTH);
}
};
SwingUtilities.invokeLater(show);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Call setExtendedState(MAXIMIZED_BOTH) after showing the frame.
- relates to
-
JDK-6525850 Creating peer makes an invisible AND iconified frame visible on the taskbar
- Closed
-
JDK-6365898 Frame.setExtendedState(Frame.MAXIMIZED_BOTH) doesn't work well on Linux
- Closed