I have 5 JRadio buttons on my swing application. When I click my Jradio button. I have created a joption dialogue to display that it is clicked. But when I unselect it it also displays that it is selected. What is the problem? One of my Jradio button coding.
private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt)
{
JOptionPane.showMessageDialog(null,"one is selected");
}
So I finally got answer
with help of @Neil Locketz
private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt)
{
if(jRadioButton1.isSelected())
{
JOptionPane.showMessageDialog(null,"one is selected");
}
}
Thanks