How do I add radio buttons to a button group using NetBeans?
Once I add them, how do I get selected radio button from the button group?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I highly recommend reading this excellent tutorial. Here’s an excerpt of code from the article that satisfies your question on how to create and add buttons to a ButtonGroup:
As far as getting which item is selected, you basically need to iterate through the items in the group calling
isSelected.