I have been created a delete button which delete some text from text field. But when I click this button and delete the text the button still selected. I want to deselect this button after clicking it.
I tried this code but it doesn't work
private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {
jTextField2.setText("");
jCheckBox1.setSelected(false);
jTextField4.setText("");
jTextField5.setText("");
jTextField6.setText("");
jButton1.setSelected(false);
}
How to make a JButton
not selected after clicking it?