• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I add a JRadioButton into JOptionPane

 
yamashita lee
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excuse Me
I want to make a JOptionPane with two JRadioButton,How can I write the source.
Any Ideas?
Thanks
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
the methods in JOptionPane take a parameter "message" of type Object. You can provide a JPanel containing a message string and radio buttons and whatever else. It will be displayed above the buttons, next to the icon (if there is one).
chantal
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pardon me, Chantal, but could you please provide some sample code to demonstrate this -- since I have, as yet, found none, and I have not managed to do this yet myself either.
Thanks (in advance),
Avi.
P.S. And please tell me what java version your code works with.
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

cheers,
Chantal
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou very much indeed, Chantal!
Avi.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!