If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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?

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!