can someone tell me how i can remove a menuitem from a context menu or even better how i can clear all items from a menu (like resetting the menu). i couldn't find any remove method or so. depending on the selected item i want different entries in my context menu. any ideas?
There are about three methods in JMenu which remove things. A different route, which some people prefer, is to use the setEnabled() method on the individual items, which is how menu items change from active (black writing default) to inactive (grey writing).
SWT? No idea. I have never actually used it. I have always written GUIs the hard way:- add(startButton = getJButton("Start", 's', "Start the application, new ActionListener() { public void actionPerformed(ActionEvent evt) { myFoo.start(); } }); etc etc You will have to try those methods, and see which works. CR
Would anybody like some fudge? I made it an hour ago. And it goes well with a tiny ad ...
Gift giving made easy with the permaculture playing cards