-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.4.2
-
x86
-
windows_xp
This issue first appeared as item #1 in bug 6425606.
When an undecorated top-level window is maximized (via setExtendedState()), the window's icon and title bar appear briefly as the window is maximizing. Once maximized, the window is again undecorated. Not a huge deal, but a bit distracting and certainly not proper behavior.
This bug has been present since the setUndecorated() API was added in 1.4 - I can reproduce on XP using 1.4.2_12, 1.5.0, and 1.6b85.
I used the following test case to reproduce this bug w/ an AWT Frame and a Swing JFrame:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MaximizeTests implements ActionListener {
static Frame frame;
static Button awtBtn;
static JFrame jframe;
static JButton jBtn;
public static void main(String[] args) {
MaximizeTests al = new MaximizeTests();
frame = new Frame("AWT Frame");
frame.setUndecorated(true);
awtBtn = new Button("Toggle Maximize");
awtBtn.addActionListener(al);
frame.add(awtBtn, BorderLayout.SOUTH);
frame.add(new Label("AWT Frame"), BorderLayout.NORTH);
frame.setBounds(10, 10, 200, 200);
jframe = new JFrame("Swing Frame");
jframe.setUndecorated(true);
jBtn = new JButton("Toggle Maximize");
jBtn.addActionListener(al);
jframe.getContentPane().add(jBtn, BorderLayout.SOUTH);
jframe.getContentPane().add(new JLabel("Swing Frame"), BorderLayout.NORTH);
jframe.setBounds(220, 10, 200, 200);
frame.setVisible(true);
jframe.setVisible(true);
}
public void actionPerformed(ActionEvent e) {
Frame src = null;
if (e.getSource() == awtBtn) {
src = frame;
}
else if (e.getSource() == jBtn) {
src = jframe;
}
if (frame != null) {
int state = src.getExtendedState();
src.setExtendedState(state ^ Frame.MAXIMIZED_BOTH);
}
}
}
When an undecorated top-level window is maximized (via setExtendedState()), the window's icon and title bar appear briefly as the window is maximizing. Once maximized, the window is again undecorated. Not a huge deal, but a bit distracting and certainly not proper behavior.
This bug has been present since the setUndecorated() API was added in 1.4 - I can reproduce on XP using 1.4.2_12, 1.5.0, and 1.6b85.
I used the following test case to reproduce this bug w/ an AWT Frame and a Swing JFrame:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MaximizeTests implements ActionListener {
static Frame frame;
static Button awtBtn;
static JFrame jframe;
static JButton jBtn;
public static void main(String[] args) {
MaximizeTests al = new MaximizeTests();
frame = new Frame("AWT Frame");
frame.setUndecorated(true);
awtBtn = new Button("Toggle Maximize");
awtBtn.addActionListener(al);
frame.add(awtBtn, BorderLayout.SOUTH);
frame.add(new Label("AWT Frame"), BorderLayout.NORTH);
frame.setBounds(10, 10, 200, 200);
jframe = new JFrame("Swing Frame");
jframe.setUndecorated(true);
jBtn = new JButton("Toggle Maximize");
jBtn.addActionListener(al);
jframe.getContentPane().add(jBtn, BorderLayout.SOUTH);
jframe.getContentPane().add(new JLabel("Swing Frame"), BorderLayout.NORTH);
jframe.setBounds(220, 10, 200, 200);
frame.setVisible(true);
jframe.setVisible(true);
}
public void actionPerformed(ActionEvent e) {
Frame src = null;
if (e.getSource() == awtBtn) {
src = frame;
}
else if (e.getSource() == jBtn) {
src = jframe;
}
if (frame != null) {
int state = src.getExtendedState();
src.setExtendedState(state ^ Frame.MAXIMIZED_BOTH);
}
}
}
- relates to
-
JDK-6425606 PIT: Child dialog inherits the wrong icon from the parent frame if the parent is LAF decorated
-
- Closed
-