[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

JInternalFrame setDefaultCloseOperation

I don't think the setDefaultCloseOperation works correctly.
What I want to do is when I click on the 'X' in the right corner of the window, that it just hides. I have tried HIDE_ON_CLOSE and that doesn't work, and I have also written my own close operations by setting DO_NOTHING_ON_CLOSE. I just want to set JInteranalFrame setVisible(false) so when I call setVisible(true) on it that it shows up again.

You can see my code below.
Any sugestions?
Thanks in advanced,

public class ApplicationWindow extends JInternalFrame implements Plugin {
 public ApplicationWindow() {
   addInternalFrameListener(new InternalFrameAdapter() {
     public void internalFrameClosing(InternalFrameEvent e) {
     System.out.println("hiding ....");
     JInternalFrame frame = (JInternalFrame)e.getSource();
setFrameIcon (new ImageIcon (ClientData.instance().getImage ("computer-small.png")));
   setIconifiable (true);
   setClosable (true);
   setResizable (true);
   setVisible(false); //don't show starting off

Reply to: