Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

Java Radio Buttons

Thread view: 
bwilde@gmail.com - 30 Jun 2005 21:45 GMT
Hello,

I am creating a GUI in Java and would like to make buttons that behave
like radio buttons but look like regular JButtons.  That is, I would
like for there to be a button group of three rectangular buttons, with
one of them always selected (and displayed differently as the other
to).  When another button is clicked, I would like to unselect the
previous one and select the current one.

The closest thing that I have seen to do this is to play around with
the icons that are used for radio buttons (although I don't think that
java lets me add new text to these images).  It seems like there should
be a simpler way of doing this, though.

Any thoughts?

Thanks.
Lee Weiner - 30 Jun 2005 22:24 GMT
>Hello,
>
[quoted text clipped - 9 lines]
>java lets me add new text to these images).  It seems like there should
>be a simpler way of doing this, though.

There is.  If you use JToggleButtons and add them to a ButtonGroup, they will
look like JButtons and act like JRadioButtons.

Lee Weiner
lee AT leeweiner DOT org


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.