-1
I am doing a java swing exercise that contains the following screen with Jradiobuttons:
When "java swing" is selected it should show a message by clicking on Jbutton and vice versa with the second option. But how to show a message when there is no option selected?
private void clickEvento(java.awt.event.ActionEvent evt) {
if (jrbJavaSwing.isSelected()) {
JOptionPane.showMessageDialog(null, "Java Swing");
}
if (jrbOutraLP.isSelected()) {
JOptionPane.showMessageDialog(null, "Outra linguagem... Tem certeza?");
}
JOptionPane.showMessageDialog(null, "Você não selecionou nada");
Because that way with this Joptionpane on the last line, it keeps returning the message always.