• Post Reply 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

JRadioButton w/a JButton

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to display a JDialog box that shows the choice the user made when a user selects the
a radio button and hits the process button. Can someone point out whats wrong with the code?
thanks

[ May 07, 2002: Message edited by: Dirk Schreckmann ]
 
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is your problem? Are you getting a compile error or just the wrong results?
 
Sean Richards
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

generates a compiler error. How can this be done in another way?
[ May 07, 2002: Message edited by: Dirk Schreckmann ]
 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you should try being more specific and just using a small sample of code because looking at all that code makes it seem like too much stuff to read and it could scare people away from attempting to help you.
If you have a Button let's call it rGroup and you have button1 and button2...I know of two ways you can check and see which one is selected either you can check this way.
if(rgroup.getSelection().equals(button1.getModel()){
//button 1 is selected
}
another way you can check is
if(rgroup.isSelected(button2.getModel())){
//button 2 is selected
}
look at the api for
javax.swing.JRadioButton
javax.swing.AbstractButton
javax.swing.ButtonGroup
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
maximillion2001,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change yer display name to comply with The JavaRanch Naming Policy.
Thanks Pardner!
 
reply
    Bookmark Topic Watch Topic
  • New Topic