0
I need to make a screen where the client has several options of radio Buttons to select, then I have to take these values and set in a class that has the field valor
.
private String nota; /*quero salvar aqui*/
public String getNota() {
return nota;
}
public void setNota(String nota){
this.nota = nota;
}
private JRadioButton getRdbtnOtimo() {
if (rdbtnOtimo == null) {
rdbtnOtimo = new JRadioButton("\u00D3timo");
rdbtnOtimo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (rdbtnOtimo.isSelected()) {
rdbtnPessimo.setSelected(false);
rdbtnNormal.setSelected(false);
rdbtnBom.setSelected(false);
rdbtnRuim.setSelected(false);
ChatMessage cm = new ChatMessage();
cm.setNota("Ótimo");
}
}
});
rdbtnOtimo.setBackground(new Color(248, 252, 255));
}
return rdbtnOtimo;
}