On demand population of dropdown menu Java/Swing?
- by Cookie Monster
When I code a popup menu, I can check the mouse event and then
before calling show() prepare the menu.
Now I want a similar functionality for drop down menus, that
live in the menu bar. For example I have the following menu
bar layout:
Menu 1
MenuItem 1.1
MenuItem 1.1.1
MenuItem 1.1.2
..
MenuItem 1.1.n
Menu 2
Basically I want to generate the list MenuItem 1.1.1, MenuItem 1.1.2,
..., MenuItem 1.1.n dynamically when the drop down menu is invoked and
before it is shown.
How could I do this in Java/Swing?
Best Regards