-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.3.0
-
x86
-
linux
Name: rmT116609 Date: 11/28/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)
Under RedHat 6.2 Linux running Gtk and Enlightenment window manager,
setVisible() fails to show previously hidden i.e. setVisible(false) frames.
Instead they remain iconised. This does not happen under Solaris with CDE window
manager.
In the following code, when the component "Other Frame" is closed i.e.
setVisible(false) is called, then it is reshown i.e. setVisible(true) is called
again - the frame remains iconised.
The problem does not seems to appear with KDE.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class ShowVisibleBug extends JFrame
{
public ShowVisibleBug()
{
super("ShowVisibleBug");
// set up component frame with just a close
// button in it
noShowFrame_ = new JFrame("Other Frame");
noShowFrame_.setSize(150, 60);
JButton closeButn = new JButton("Close");
closeButn.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
noShowFrame_.setVisible(false);
}
});
noShowFrame_.getContentPane().add(closeButn);
// add button which SHOULD - but doesn't redisplay
// the component frame (on the 2nd attemp)
JButton showButn = new JButton("Show other frame");
showButn.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
noShowFrame_.setVisible(true);
// workaround
// if (noShowFrame_.getState() == Frame.ICONIFIED)
// {
// noShowFrame_.setState(Frame.NORMAL);
// }
}
}
);
getContentPane().add(showButn);
setSize(200, 60);
}
JFrame noShowFrame_;
static void main(String[] args)
{
ShowVisibleBug svb = new ShowVisibleBug();
svb.setVisible(true);
svb.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}
);
}
}
(Review ID: 112834)
======================================================================
- duplicates
-
JDK-4392518 Incorrect window (swing) handling with Gnome/enlightenment
-
- Resolved
-