adding MenuItems to menu


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: adding MenuItems to menu

  1. #1
    Franco Guest

    adding MenuItems to menu


    Hi all,

    I have a menu which has a bunch of submenus. One of these submenus contains
    about 40 menuitems. Since it is too long it
    runs off the screen. I need a way to some how scroll these
    menu Items, so the submenu won't go off the screen.

    First I tried to implement a new class that extends a JComboBox
    and implements MenuElement interface. It works, but when I
    click on the combo box, the popup menu hide itself before I do my selection.
    Is there any way to keep the popmenu till i do
    my selection?

    Another attemp, I created a new class that extends JPanel and
    impelments menuElement. I set the layout of JPanel to GridLayout(10,4) and
    add JRadioButtonMenuItems to the panel. Again, the look is fine, BUT as soon
    as the mouse passes over any of the
    JRadioMenuItems, the popup disappears before I even do my selection. Any
    body know why or how to fix it?

    Any suggestions!

  2. #2
    Paul Clapham Guest

    Re: adding MenuItems to menu

    I applaud your ingenious fix attempts, but my solution would be to not have
    40 items in a menu.

    Franco <franco@hotmail.com> wrote in message
    news:39996c29$1@news.devx.com...
    >
    > Hi all,
    >
    > I have a menu which has a bunch of submenus. One of these submenus

    contains
    > about 40 menuitems. Since it is too long it
    > runs off the screen. I need a way to some how scroll these
    > menu Items, so the submenu won't go off the screen.
    >
    > First I tried to implement a new class that extends a JComboBox
    > and implements MenuElement interface. It works, but when I
    > click on the combo box, the popup menu hide itself before I do my

    selection.
    > Is there any way to keep the popmenu till i do
    > my selection?
    >
    > Another attemp, I created a new class that extends JPanel and
    > impelments menuElement. I set the layout of JPanel to GridLayout(10,4) and
    > add JRadioButtonMenuItems to the panel. Again, the look is fine, BUT as

    soon
    > as the mouse passes over any of the
    > JRadioMenuItems, the popup disappears before I even do my selection. Any
    > body know why or how to fix it?
    >
    > Any suggestions!




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center