Hi, I'm using Swing Actions to build both my menu and toolbar. For the Toolbar I define an icon that is properly displayd. Unfortunately the same icon is displayed in the menu, which looks quite ugly. i browsed the JMenuBar API to find a swich without success.
can anybody tell me, how to avoid the action's icon to be displayed in the menu? I would prefere a generic way so this would work for all my actions/menues at once.
I did something similar, but I had a different icon for the toolbar then for the menu. I extended AbstractAction so that it called the parent constructor and saved the second (small) icon. Then I inherited my actions from this "AbstractAction2Icons" class.
Apart from that I created my own SmallIconMenuItem (extending JMenuItem). It's constructor tool AbstractAction2Icons as an argument, called super(Action ) and then setIcon to the other icon.
I believe you might be able to call setIcon (null) or something like that. You actually don't need to extend AbstractAction. Just extend JMenuItem, create the constructor that takes Action, call super and then set icon...
Let me know how it went... Petr
Get a better web browser:<br /><a href="http://www.mozilla.org/products/firefox/switch.html" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/switch.html</a>