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

MetalInternalFrameUI.installKeyboardActions doesn't install listener

XMLWordPrintable

    • beta
    • generic
    • generic



      Name: dbT83986 Date: 03/31/99


      Reproduce:
      When using the SwingSet app. Put a breakpoint into JInternalFrame.dispose. This will not be called when using the MetalUI.


      The method installKeyboardActions in the BasicInternalFrameUI installs the InternalFrameListener. If the MetalInternalFrameUI overrides this
      method without calling the inherited method it will not install the InternalFrameLister.

      Resolution:
      There are multiple ways to fix this problem.
      1. Change the MetalInternalFrameUI to.
        protected void installKeyboardActions(){
      super.installKeyboardActions();
        }
      2. Change the MetalInternalFrameUI to.
        protected void installKeyboardActions(){
          if (internalFrameListener == null)
            createInternalFrameListener();
          // skip (presume this was the reason for the override
          //openMenuKey = KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, KeyEvent.CTRL_MASK);
          frame.addInternalFrameListener(internalFrameListener);
        }
      3. Insert the following code into the BasicInternalFrameUI.installUI
          if (internalFrameListener == null)
            createInternalFrameListener();
          frame.addInternalFrameListener(internalFrameListener);
      (Review ID: 56330)
      ======================================================================

            hgajewsksunw Hania Gajewska (Inactive)
            dblairsunw Dave Blair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: