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

Shortcoming in the way JMenuItem handles 'propertyChange()' events.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 1.4.0, 1.4.2
    • client-libs
    • None
    • beta
    • generic, x86
    • generic, solaris_8, windows_xp

      We can create JMenuItem from an action. When you do that, the JMenuitem calls 'setAction()' which is in its superclass AbstractButton.'setAction()' in AbstractButton calls configurePropertiesFromAction() which sets all the properties including tooltip text from Action.SHORT_DESCRIPTION.
      Also, at this time, JMenuItem adds itself as a propertyChange listener
      to listen for property change events.

      After this whenever we update the 'SHORT_DESCRIPTION' of the Action
      instance, the JMenuItem instance does not reflect the change in its
      tooltip. This is because, its propertyChange() method does not listen
      for changes to 'SHORT_DESCRIPTION'. This is the shortcoming I am
      referring to. During construction, JMenuItem sets everything by passing
      it to its superclass, but when there is change on some of the
      properties, JMenuItem does not reflect the change because its change
      listener is not listening for them ( in particular changes to
      SHORT_DESCRIPTION ).

            kizune Alexander Zuev
            rramchansunw Rajesh Ramchandani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: