Java: JRadio Button

Posted on 2007-09-28
Last Modified: 2010-05-18
       c1=new JRadioButton(" apple ");
        c2=new JRadioButton("    Orange     ");
        btGroup=new ButtonGroup();
        Hi, i have radio buttons that are in a group. I am trying to get the value of the radio button that i select. how do i do that ?
Question by:zizi21
    LVL 23

    Accepted Solution


    Author Comment

    if i use the getActionCommand() to get the string, than i have problem using it for buttons..coz, currently,
    i am using actionPerformed for my jbuttons as well.
    It is it possible to refresh the actioncommand ?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    This video teaches viewers about errors in exception handling.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now