wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JCheckBox and JRadioButton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic
Author

JCheckBox and JRadioButton

Berkant Ozer
Greenhorn

Joined: Apr 24, 2010
Posts: 4
Hi guys,

When JOptionPane shows the results, I always get "TRUE" and "FALSE" not their names

I think I need to use method getSelectedItem().toString() to get the value of JCheckbox or JRadioButton.

any help you can give me would be appreciated.

Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3177
    
  47

Berkant, Please UseAMeaningfulSubjectLine instead of something like "Need Help" when you post a question.
Please edit your post to add a meaningful subject line by clicking the button.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Jonas Isberg
Ranch Hand

Joined: Mar 18, 2003
Posts: 118
It would probably be easier to understand the problem if you could reduce your code to
its simplest form that still has the current problem. I don't know which variable(s) that is
the offending one(s), nor the exact type and I cannot try to run it on my own, I could
offer the follow links though. :-)

HowToAskQuestionsOnJavaRanch
smart-questions
Berkant Ozer
Greenhorn

Joined: Apr 24, 2010
Posts: 4
It's my first time here.

The problem is:
when the user selects GPS at the optional part and then clicks the submit button, the part of "optinal" comes with saying "TRUE FALSE".
I don't know how JCheckBox and JRadioButton come their name that are selected by users
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2203
    
    7
I don't know how JCheckBox and JRadioButton come their name that are selected by users




If you need more hep you should create a SSCCE, that demonstrates the incorrect behaviour.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19723
    
  20

Rob Camick wrote:SSCCE

Pssst. Since the last deployment You no longer need to create a link manually. Just type in SSCCE and it becomes a link automatically!
Since we often point to that site from this forum I asked it to be added to the auto-link list.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Berkant Ozer
Greenhorn

Joined: Apr 24, 2010
Posts: 4
I want to delete this thread. How can I do that?

Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3177
    
  47

Why do you need to delete it?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

You can't.
Even if you did, why would you want to do that?

Damn. Devaka beat me to it


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Berkant Ozer
Greenhorn

Joined: Apr 24, 2010
Posts: 4
because I didn't get any help. I've done it by myseld
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> because I didn't get any help. I've done it by myself

instead of asking for deletion, what about being a good sport and posting your solution,
so that anyone else with a similar problem wouldn't need to 'ask' for help, they'd be
able to find it here.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JCheckBox and JRadioButton