• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to implement collapse on select in JMenu with JRadioButton as items?

 
Kurt Zhu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As for a common JMenuItem, it seems to be defaulted to collapse on select.

Now I added two jRadioButtons in a menu, when I click on one, the command finishes but the radio menu is still there seemingly requests another select.

I need to make it a collapse on select mode for user friendliness.

How can that be done? Thank you guys.
 
Kurt Zhu
Greenhorn
Posts: 8
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, I got it.

I should not have used JRadioButton, should rather JRadioButtonMenuItem。

Someone gave me this in baidu.

Thanks.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm glad you got it resolved

However, since this is a Swing topic, I've moved your thread to a better suited forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic