This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JtoggleButton, JCheckBoxMenuItem & Action  RSS feed

 
Korol Bloom
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have an Action that should be triggered by a JToggleButton (from a JToolBar) and a JCheckBoxMenuItem (from a JMenu). The Button should display an icon, the menu item should display both icon and text.
The problem is: By default the JToggleButton displays both text and icon, and I need to find a way to hide the text. For a common JButton you can do this by

, but this does not work for a JToggleButton. Does anybody know a solution? Maybe I could try a JToggleButton subclass or don't use Action for the button, but this doesn't seem to be the proper way.
, korol
 
Korol Bloom
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, it seems to be easy:

, korol
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!