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

Menu/JMenu must support scrolling.

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 5.0, 6, 6u2
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux, windows_xp

      Description

      A DESCRIPTION OF THE REQUEST :
      When the number if items in the Menu/JMenu increases, it is very difficult to view all the menu items available in that menu.

      JUSTIFICATION :
      There is a very fair chance that there may be many items added to the Menu or JMenu. So some kind of scrolling mechanism must be available to see all the items in the Menu/JMenu.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      1:
      User should be able to specify the total number of elements (MenuItem) to be visible in a given Menu/JMenu when shown. If the number of MenuItem exceed this number, then a scrolling mechanism should be automatically added.

      2:
      The scroll UI can be placed on top and bottom of the Menu/JMenu at all time. It can be enabled on specific condition like when the number of elements (MenuItem) exceed the total number of items to be shown at a time.

      This functionality is something similar to the enabling the scrolling feature in the Start-> Programs Menu in the Windows environment.
      ACTUAL -
      For example, if my application has a menu that contains more than 25-30 MenuItems then there is no option of scrolling available.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      public class ActionTest extends JFrame
      {
          JMenuBar jmenubar = new JMenuBar();
          JMenu fileMenu = new JMenu("File");

          public ActionTest()
          {
              super("ActionTest");
              for(int i=1;i<=50; i++)
              {
                  fileMenu.add(new JMenuItem("Menu Item " + i));
      }

              jmenubar.add(fileMenu);
              this.setJMenuBar(jmenubar);
              setSize(200, 200);
          }

          public static void main(String[] args)
          {
              ActionTest at = new ActionTest();
              at.show();
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Still working on it...

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                volk Konstantin Voloshin (Inactive)
                Reporter:
                ndcosta Nelson Dcosta (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: