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

Infinite loop hiding then showing a JInternalFrame

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_95

      Description



      Name: rk38400 Date: 04/16/98


      java.lang.StackOverflowError
              at java.awt.Component.getToolkit(Component.java:332)
              at java.awt.Component.getToolkit(Component.java:332)
              at java.awt.Component.getToolkit(Component.java:332)
              at java.awt.Component.getToolkit(Component.java:332)
              at java.awt.Component.getToolkit(Component.java:332)
              at java.awt.Component.getToolkit(Component.java:332)
              at java.awt.Component.getFontMetrics(Component.java:1182)
              at com.sun.java.swing.text.PlainView.updateMetrics(PlainView.java:184)
              at com.sun.java.swing.text.PlainView.getPreferredSpan(PlainView.java:218
      )
              at com.sun.java.swing.text.DefaultTextUI$RootView.getPreferredSpan(Defau
      ltTextUI.java:690)
              at com.sun.java.swing.text.DefaultTextUI.getPreferredSize(DefaultTextUI.
      java:455)
              at com.sun.java.swing.JComponent.getPreferredSize(JComponent.java:705)
              at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:340)
              at java.awt.Container.preferredSize(Container.ja
      java.lang.StackOverflowError
              at java.awt.Component.getToolkit(Component.java:332)
              at java.awt.Component.getToolkit(Component.java:332)
              at java.awt.Component.getToolkit(Component.java:332)
              at java.awt.Component.getToolkit(Component.java:332)
              at java.awt.Component.getToolkit(Component.java:332)
              at java.awt.Component.getToolkit(Component.java:332)
              at java.awt.Component.getFontMetrics(Component.java:1182)
              at com.sun.java.swing.text.PlainView.updateMetrics(PlainView.java:184)
              at com.sun.java.swing.text.PlainView.getPreferredSpan(PlainView.java:218
      )
              at com.sun.java.swing.text.DefaultTextUI$RootView.getPreferredSpan(Defau
      ltTextUI.java:690)
              at com.sun.java.swing.text.DefaultTextUI.getPreferredSize(DefaultTextUI.
      java:455)
              at com.sun.java.swing.JComponent.getPreferredSize(JComponent.java:705)
              at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:340)
              at java.awt.Container.preferredSize(Container.ja
              at java.awt.Container.preferredSize(Container.java:573)
              at java.awt.Container.getPreferredSize(Container.java:556)
              at com.sun.java.swing.JComponent.getPreferredSize(JComponent.java:707)
              at com.sun.java.swing.JRootPane$RootLayout.preferredLayoutSize(JRootPa
      .java:372)
              at java.awt.Container.preferredSize(Container.java:573)
              at java.awt.Container.getPreferredSize(Container.java:556)
              at com.sun.java.swing.JComponent.getPreferredSize(JComponent.java:707)
              at com.sun.java.swing.plaf.basic.BasicInternalFrameUI.preferredLayoutS
      e(BasicInternalFrameUI.java:293)
              at com.sun.java.swing.plaf.basic.BasicInternalFrameUI.getPreferredSize
      asicInternalFrameUI.java:140)
              at com.sun.java.swing.JComponent.getPreferredSize(JComponent.java:705)
              at com.sun.java.swing.JInternalFrame.pack(JInternalFrame.java:1047)
              at com.sun.java.swing.JInternalFrame.show(JInternalFrame.java:1062)
              at java.awt.Component.show(Component.java:498)
              at java.awt.Component.setVisible(Component.java:460)
              at com.sun.java.swing.JComponent.setVisible(JComponent.java:1168)
              at com.sun.java.swing.JInternalFrame.setVisible(JInternalFrame.java:45

              at com.sun.java.swing.JInternalFrame.show(JInternalFrame.java:1064)
              at com.sun.java.swing.JInternalFrame.setVisible(JInternalFrame.java:458)

              at com.sun.java.swing.JInternalFrame.show(JInternalFrame.java:1064)
              at java.awt.Component.show(Component.java:498)
              at java.awt.Component.setVisible(Component.java:460)
              at com.sun.java.swing.JComponent.setVisible(JComponent.java:1168)
              at com.sun.java.swing.JInternalFrame.setVisible(JInternalFrame.java:458)

              at com.sun.java.swing.JInternalFrame.show(JInternalFrame.java:1064)
              at java.awt.Component.show(Component.java:498)
              at java.awt.Component.setVisible(Component.java:460)
              at com.sun.java.swing.JComponent.setVisible(JComponent.java:1168)
              at com.sun.java.swing.JInternalFrame.setVisible(JInternalFrame.java:458)

              And so on. Here is the source code

          /** Removes the frame from it's parent and adds it's desktopIcon to the parent. */
          public void iconifyFrame(JInternalFrame f)
          {
               
              f.setVisible (false);
                
              desktop.repaint(f.getX(), f.getY(), f.getWidth(), f.getHeight());
              try
               {
                  f.setSelected(false);
               } catch (PropertyVetoException e2) { }
          }
      //**********************************************************************************

          /** Removes the desktopIcon from it's parent and adds it's frame to the parent. */
          public void deiconifyFrame(JInternalFrame f)
          {
                
               f.setVisible (true);
               
               try { f.setSelected(true); } catch (PropertyVetoException e2) { }
           }

          This is in a class that extends a DefaultDesktopManager
      (Review ID: 28294)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dmendenhsunw David Mendenhall (Inactive)
                Reporter:
                rkarsunw Ralph Kar (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: