Radio button

Does radio buttons have indexes or hidden values, lets say if the first radio button is selected, teh hidden value is taken.
zizi21Asked:
Who is Participating?
 
maheshexpCommented:
Define your own class extending JRadioButton.

class YourRadioButton extendds JRadioButton
{
        <Your DataType> selectedValue ;

      // write the getLogic for the data you want to return.

       public <Your Data type> getValue()
     {
               .....
     }

}

Now in your code, where in your code want to get the value for your selected use getValue().
0
 
CMSnetTechCommented:
Yes it is possible that hidden values can be sent back. Here is a good reference to what you might be looking for. You can do this with java scripting.

Take a look


www.codingforums.com/archive/index.php?t-7275.html 
0
 
CEHJCommented:
Have you got a web application here?
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
zizi21Author Commented:
actually, a jframe..
0
 
zizi21Author Commented:
actually, i am know how to do hidden value for jsp, . but for application, i am trying..is
0
 
CEHJCommented:
Since Swing is based on the MVC pattern, you would be better off extending the model, not the view/controller. Extend http://java.sun.com/javase/6/docs/api/javax/swing/DefaultButtonModel.html
0
 
CEHJCommented:
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.