Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what kind of action listener will i apply to this

 
Roldan Baldo
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i click the button the hehe label will not change to work . i want the label to change everytime i click the button.


 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're calling setName, but it's the setText method that will change the caption of the label.
 
Roldan Baldo
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wow. that solves it.. thanks a lot.
 
Rob Poulos
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are calling label.setName(word);

you need to call label.setText(word);
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing forum
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic