File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes radiobutton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "radiobutton" Watch "radiobutton" New topic


amrit sharma

Joined: Apr 05, 2010
Posts: 8
i just need to know if i can appy if else condition inside the actionlistener event for the selection of a particular radion button...

for eg:

if(some condtion for radiobutton1)
call frame1

else if(some condtion for radiobutton2)
call frame2

is this possible??
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
really, what happened when you tried it?
amrit sharma

Joined: Apr 05, 2010
Posts: 8
no i haven't tried it yet...but is it possible....??

like if i write...
then stmt.

Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2451
8 hours later....

what happened when you tried it?
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46349
amrit sharma wrote: . . . if(radiobutton1.Checked=true) . .

even if you are using the = in its true sense as an equality operator, that is still bad code style.
dushantha Rathnayake
Ranch Hand

Joined: Feb 27, 2010
Posts: 103
If you want to learn java, you must try with your cods.
Remember that first.
I agree. Here's the link:
subject: radiobutton
It's not a secret anymore!