• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Buttons not re-displaying?

 
Greenhorn
Posts: 7
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
what if we put solar panels on top of the semi truck trailer? That could power this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic