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

Problem DeIconifying an Internal Frame that is initally iconified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.1
    • 1.3.0, 1.3.1, 1.4.0
    • client-libs
    • hopper
    • generic, x86
    • generic, windows_nt, windows_2000
    • Not verified



      Name: boT120536 Date: 04/17/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode

      When a call is made to JDesktopPane.getDesktopManager().iconifyFrame(),
      problems occur when trying to manually restore the frame.

        To replicate the problem, run the attached code below. When the desktop
      appears you will see an iconified internal frame. Clicking on it will NOT
      restore it!

      Next, uncomment the code that sets the look and feel then rerun the program.
      Now you see the iconified internal frame with a minimize icon showing. This is
      incorrect and should be showing the deiconify restore icon instead. Now click
      the minimize icon and it changes to the restore icon, but doesn't restore the
      frame as expected. Now click the restore icon and the frame pops up and from
      then on all works as expected.

      Sample code:

      package test;

      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class IconifyTest {
        JFrame deskFrame;
        JDesktopPane desktop;

        public static void main(String[] args) {
          new IconifyTest();
        }

        public IconifyTest() {
          //try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
          //catch (Exception e) {}

          desktop = new JDesktopPane();

          deskFrame = new JFrame();
          deskFrame.getContentPane().add(desktop);
          deskFrame.setSize(500, 300);
          deskFrame.show();

          AddFrame();
        }

        private void AddFrame() {
          JInternalFrame frame = new JInternalFrame("", false, false, false, true);
          frame.getContentPane().setLayout(new FlowLayout());
          frame.getContentPane().add(new JTextField(10));
          frame.setSize(300, 200);
          frame.setVisible(true);

          desktop.add(frame);
          desktop.getDesktopManager().openFrame(frame);
          desktop.getDesktopManager().iconifyFrame(frame);
        }
      }
      (Review ID: 118482)
      ======================================================================

      Name: yyT116575 Date: 08/09/2001


      java version "1.3.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
      Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

      In an applet with a MetalLookAndFeel,
      1. Create a DesktopPane.
      2. Create a JInternalFrame.
      3. Add the JInternalFrame to the DesktopPane.
      4. use DesktopPane.getDesktopManager.iconifyFrame( JInternalFrame ) to iconify the JInternalFrame.
      5. Run the applet. Teh JInternalFrame should be shown in the iconified state.
      6. Click the JInternalFrame icon to maximize it. It will not maximize.

      The reason is that The JInternalFrame's DesktopIcon is calling the setIcon(false ) of the JInternalFrame. setIcon( false ) returns without maximizing the JInternalFrame because it checks the isIcon variable that wasn't set to true when DesktopPane.getDesktopManager.iconifyFrame( JInternalFrame ) was executed.
      (Review ID: 129656)
      ======================================================================


      ###@###.### 2002-01-03

      This problem still exists in the latest build 90 of merlin.

            joutwatesunw Joshua Outwater (Inactive)
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: