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

Bad logic in actionPerformed() of BasicInternalFrameTitlePane.java.

XMLWordPrintable

    • swing0.8
    • generic
    • solaris_2.5
    • Verified

      In the following code snippet -

         192 if("Close".equals(e.getActionCommand()) && frame.isClosable())
         193 try { frame.setClosed(true); } catch (PropertyVetoException e0) { }
         194 else if("Iconify".equals(e.getActionCommand()) && frame.isIconifiable()) {
         195 if(!frame.isIcon())
         196 try { frame.setIcon(true); } catch (PropertyVetoException e1) { }
         197 else
         198 try { frame.setIcon(false); } catch (PropertyVetoException e1) { }
         199 } else if("Minimize".equals(e.getActionCommand()) && frame.isMaximizable()) {
         200 try { frame.setIcon(true); } catch (PropertyVetoException e2) { }
         201 } else if("Maximize".equals(e.getActionCommand()) && frame.isMaximizable()) {
         202 if(!frame.isMaximum()) {
         203 try { frame.setMaximum(true); } catch (PropertyVetoException e5) { }
         204 } else {
         205 try { frame.setMaximum(false); } catch (PropertyVetoException e6) { }
         206 }
         207 } else if("Restore".equals(e.getActionCommand()) && frame.isMaximum() && frame.isMaximizable()) {
         208 try { frame.setMaximum(false); } catch (PropertyVetoException e4) { }
         209 } else if("Restore".equals(e.getActionCommand()) && frame.isIcon() && frame.isIconifiable()) {
         210 try { frame.setIcon(false); } catch (PropertyVetoException e4) { }
         211 }


      there are problems -

      At line 207, frame.isMaximum() should be checked after frame.isMaximum().
      At line 209, frame.isIconifiable() should be checked after frame.isIcon().


            tballsunw Tom Ball (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: