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

setHideActionIcon(boolean) method for JMenuItem and JButton.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 6u10, 7
    • client-libs
    • generic, x86
    • generic, windows_xp

      A DESCRIPTION OF THE REQUEST :
      There shall be a setHideActionIcon(boolean) method for JMenuItem and JButton.

      When setHideActionIcon(true) is called, the icon of the action associated with thie menu item or button shall not be shown.

      JUSTIFICATION :
      When associating an action with a menu item or button, that component then shows the icon of that action. But many applications don't want to show icons in menus in general. Also it is often the case that a particular button shall not show an icon, while others linked to the same action shall show it.

      As there is a setHideActionText(boolean) method already hiding the action's text, it is just straightforward to provide the same functionality with a similar name for icons.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      If not called, the default shall be backwards compatibility, i. e. showing the icon.

      setHideActionIcon(true) makes the component not showing the action's icon

      setHideActionIcon(false) makes the component show the action's icon
      ACTUAL -
      As soon as setAction(Action) is called, the component shows the action's icon. To remove it, setIcon(null) must get called.

      CUSTOMER SUBMITTED WORKAROUND :
      setIcon(false) after setAction(Action)

            alexp Alexander Potochkin (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: