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

PIT: Vista(Win LAF) Pressing ESC Key throws "java.lang.ClassCastException: javax.swing.JPopupMenu"

    Details

    • Subcomponent:
    • Introduced In Build:
      b02
    • Introduced In Version:
      6u1
    • Resolved In Build:
      b10
    • CPU:
      x86
    • OS:
      windows_vista
    • Verification:
      Verified

      Backports

        Description

        Build Info:
        java version "1.5.0-2007-01-18-141443.idk.5-0u12"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-2007-01-18-141443.
        idk.5-0u12-Administrator_18_jan_2007_14_19)
        Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)

        OS Info: Windows Vista Ultimate 6000

        On WindowsLAF, on Vista, when the second level PopupMenu displayed, Pressing ESC Key results in throwing this following exception, after that PopupMenu is not rendering properly at all.

        You can reproduce this for the Normal Menu too, but it's not consistent.

        Steps to reproduce:

        - Run the attached test MenuTest.java
        - Right Click on the TextArea, will display the JPopupMenu
        - Traverse through the SubMenu 1 -> SubMenu 2 -> SubMenu 3
        - Now Press the ESC key to dispose the PopupMenu, results in the following exception

        To reproduce this with Menu

        - Run the attached MenuLAFDemo.java
        - Change the LAF to Windows using the "LookAndFeel" Menu
        - Now click on the "MultiLevelMenu"
        - Traverse to "MultiLevelMenuItem" -> "SecondLevelMenuItem - 4"
        - Keep it selected, don't traverse next to the next level
        - Now press ESC Key, throws the same execption.

        Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.JPopupMenu
                at com.sun.java.swing.plaf.windows.WindowsMenuUI$1.getState(WindowsMenuUI.java:56)
                at com.sun.java.swing.plaf.windows.WindowsIconFactory$VistaMenuItemCheckIconFactory$VistaMenuItemCheckIcon.getIcon(WindowsIconFactory.java:833)
                at com.sun.java.swing.plaf.windows.WindowsIconFactory$VistaMenuItemCheckIconFactory$VistaMenuItemCheckIcon.getIconWidth(WindowsIconFactory.java:735)
                at javax.swing.plaf.basic.BasicMenuItemUI.layoutMenuItem(BasicMenuItemUI.java:823)
                at javax.swing.plaf.basic.BasicMenuItemUI.paintMenuItem(BasicMenuItemUI.java:580)
                at javax.swing.plaf.basic.BasicMenuItemUI.paint(BasicMenuItemUI.java:514)
                at javax.swing.plaf.basic.BasicMenuItemUI.update(BasicMenuItemUI.java:510)
                at javax.swing.JComponent.paintComponent(JComponent.java:743)
                at javax.swing.JComponent.paint(JComponent.java:1006)
                at javax.swing.JComponent.paintChildren(JComponent.java:843)
                at javax.swing.JComponent.paint(JComponent.java:1015)
                at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4972)
                at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4925)
                at javax.swing.JComponent._paintImmediately(JComponent.java:4868)
                at javax.swing.JComponent.paintImmediately(JComponent.java:4675)
                at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
                at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
                at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
                at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
                at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
                at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
                at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
                at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
                at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  idk Igor Kushnirskiy (Inactive)
                  Reporter:
                  esubramasunw Elancheran Subramanian (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: