Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4151444

Restore button doesn't work for JInternal Frame

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.6
    • client-libs



      Name: mf23781 Date: 06/23/98


      When using JInternalFrames placed in a JDesktopPane,
      maximizing the frame,then minimize the frame, then
      maximizing the frame, then restoring the frame doesn't
      restore the internal frame. The restore button changes to a
      maximise button as it should do if the JInternalFrame was being
      restored to its minimised state, but the JInternalFrame remains
      in the maximised state.

      When using JInternalFrames placed in a JDesktopPane, minimizing the frame, followed by maximizing, followed by minimizing, followed by maximizing causes the frame to disappear.
      Source code follows:
       
      import java.awt.*;
      import com.sun.java.swing.*;
       
      public class minmax
      {
          public static void main(String args[])
          {
              try
              {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              }
              catch (Exception e)
              {
              }
              // build the main window
              JFrame frame = new JFrame();
              frame.setSize(new Dimension(600, 400));
              JDesktopPane desktop = new JDesktopPane();
              JPanel mainPanel = new JPanel();
              mainPanel.setLayout(new BorderLayout());
              mainPanel.add(BorderLayout.CENTER,desktop);
              frame.setContentPane(mainPanel);
              frame.setTitle("desktop");
              frame.show();
              frame.validate();
              frame.repaint();
              // build some jinternal frames
              JInternalFrame win1 = new JInternalFrame("win1", true, true, true, true);
              win1.setBounds(new Rectangle(0, 0, 100, 100));
              JInternalFrame win2 = new JInternalFrame("win2", true, true, true, true);
              win2.setBounds(new Rectangle(0, 0, 100, 100));
              desktop.add(win1, desktop.DEFAULT_LAYER);
              desktop.add(win2, desktop.DEFAULT_LAYER);
         }
      }

      NB. This is the same test case as the one in bug 4150568 and
      may be related.

      ======================================================================

            joutwatesunw Joshua Outwater (Inactive)
            miflemi Mick Fleming
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: