-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
b03
-
x86
-
linux
-
Verified
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_06-b05, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux muellerp02linux 2.6.11.4-20a-smp #1 SMP Wed Mar 23 21:52:37 UTC 2005 x86_64 x86_64 x86_64 GNU/Linux
EXTRA RELEVANT SYSTEM CONFIGURATION :
I also observe this problem on 32-bit Linux and under the 12 Jan 2006 Snapshot release of Java 6.
A DESCRIPTION OF THE PROBLEM :
On Linux, Java windows that are parented to a Java frame don't follow the frame's state as expected. For example, if the frame is minimized the child windows remain visible. If another frame is activated on top of a frame that has children, the children remain in front of both frames.
On Windows the children behave as exepected, disappearing when their parent is minimized and going behind frames that are on top of their parent.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the provided code: java ChildWindowProblem
2. Observe that the child window appears on-top of both its parent frame and the other frame.
3. Minimize the parent frame and observe that the child stays visible
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
2. I exepct the child to go behind the frame that is not its parent when that frame is on top.
3. I expect the child to disappear when its parent is minimized.
ACTUAL -
2. The child is always on top of all frames
3. The child remains when the parent is minimized
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
public class ChildWindowProblem
{
public static void main(String[] args) {
JFrame parentFrame = new JFrame("Parent Frame");
parentFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JWindow childWindow = new JWindow(parentFrame);
JLabel childLabel = new JLabel("Child Window");
childLabel.setHorizontalAlignment(JLabel.CENTER);
childLabel.setBorder(BorderFactory.createLineBorder(Color.blue.darker(), 5));
childWindow.getContentPane().add(childLabel);
JFrame otherFrame = new JFrame("Other Frame");
parentFrame.setBounds(100, 100, 600, 400);
childWindow.setBounds(200, 200, 300, 200);
otherFrame.setBounds(150, 150, 300, 400);
parentFrame.setVisible(true);
childWindow.setVisible(true);
otherFrame.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
I've been able to work around this using a WindowListener on the parent frame. The WindowListener hides/shows owned children when the frame is iconified/deiconified. It also calls toBack/toFront on the children in response to windowDeactivated/windowActivated.
The latter part of this workaround is less than ideal.
- relates to
-
JDK-5070056 REGRESSION: JWindow stays on top of all other windows
- Resolved
-
JDK-6893222 test/java/awt/Window/AlwaysOnTop/AlwaysOnTopEvenOfWindow.java doesn't belong in OpenJDK6
- Resolved
-
JDK-5090481 REG: Iconifying a parent frame does not iconify the child window on XToolkit
- Closed
-
JDK-6504385 TrayIcon's tooltip is shown below the taskbar, XAWT
- Closed
-
JDK-5028924 AlwaysOnTop(RFE #4303256) don't work on linux flavours & solaris with XToolkit
- Closed
-
JDK-6470678 Detached "popup" window is persistent on all Linux/X/Workspace_Switcher
- Closed
-
JDK-6709904 JDialogs do not appear on correct workspace under CDE
- Closed
-
JDK-6669302 JCK 6a test api/java_awt/interactive/WindowTest.html#WindowTest[WindowTest0001] fails on Ubuntu
- Closed
-
JDK-6393590 Windows do not hide when changing the workspaces on SolSparc10-JDS
- Closed
-
JDK-5050898 a Window(Frame) fails to Hide() on X-Win gimp-panel context switch
- Closed