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

Buttons not re-displaying?  RSS feed

 
Ryan Taubert
Greenhorn
Posts: 7
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What i'm doing is a simple image viewer & everything is fine other than my buttons.

I can't seem to display the buttons so that I click on 1 & it replaces the IconImage with another one. If you don't get what I'm trying to explain, maybe my bit of code for the buttons will be a better explanation.



In the first button's actionevent you'll get a better understanding of what I'm trying to do. (Click on the button, change the image icon).
 
Tony Docherty
Bartender
Posts: 3264
81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the first button's actionevent you'll get a better understanding of what I'm trying to do. (Click on the button, change the image icon).

You aren't changing the buttons icon, you are calling the radioButtons() method again which will create a whole new set of buttons. You need to call the button's setIcon() method.

BTW Can I suggest you use the Java Naming Conventions as it makes the code easier for everyone to read eg class names start with an uppercase letter, variable and method names start with an lowercase letter etc.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!