Hi friends,
I have created new GUI project in Netbeans and i placed a JButton. I have also add the Event handling by JButton(right click)-->events-->mouse-->mouse clicked. I just print "hello" when the button is clicked and disable the button by setting his property.
private void jButton1MousePressed(java.awt.event.MouseEvent evt) { // TODO add your handling code here: jButton1.setEnabled(false); //(or)jButton1.setSelected(true); System.out.println("hello"); }
Now i have a strange problem. Once the button is clicked, it becomes disabled and hello is printed and next time when i click the disabled button , that time also the event handling procedure is called and hello is printed again. But i don't want to print hello when clicking disabled button.
What to do? Where i have made the mistake??
with regards,
Raja Pandi