Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Change toggleButton colour  RSS feed

 
John Joe
Ranch Hand
Posts: 358
2
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wonder how to change the jToggleButton in java.

 
Les Morgan
Rancher
Posts: 767
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

make sure you are not blocking the EDT.
John Joe wrote:I wonder how to change the jToggleButton in java.

 
Piet Souris
Rancher
Posts: 1943
66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No need for refresh. That will be done automatically.

If you put this code into an ActionListener, you can then add this ActionListener to all your
togglebuttons. You do not need to inspect all the buttons to find out which one it was.
Just use: getSource().setEnabled(false).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!