This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How to implement collapse on select in JMenu with JRadioButton as items? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to implement collapse on select in JMenu with JRadioButton as items?" Watch "How to implement collapse on select in JMenu with JRadioButton as items?" New topic
Author

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

Kurt Zhu
Greenhorn

Joined: Aug 25, 2011
Posts: 8
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

Joined: Aug 25, 2011
Posts: 8
Oh, I got it.

I should not have used JRadioButton, should rather JRadioButtonMenuItem。

Someone gave me this in baidu.

Thanks.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3606
    
  60

I'm glad you got it resolved

However, since this is a Swing topic, I've moved your thread to a better suited forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to implement collapse on select in JMenu with JRadioButton as items?
 
Similar Threads
change the scrollbar of the select menu
Expand/Collapse functionality on JSP page
Programmatically expand or collapse t:panelNavigation2
JMenuBar
How to write a javascript function to exapand/collapse all nodes in a TreeMenu