Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JCheckBox and JRadioButton

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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.

 
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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.
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

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.
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

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.
 
Berkant Ozer
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I want to delete this thread. How can I do that?

 
Devaka Cooray
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Why do you need to delete it?
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
You can't.
Even if you did, why would you want to do that?

Damn. Devaka beat me to it
 
Berkant Ozer
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
because I didn't get any help. I've done it by myseld
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
> 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.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic