• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what kind of action listener will i apply to this

 
Roldan Baldo
Ranch Hand
Posts: 99
  • 0
  • 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: 20368
43
Chrome Eclipse IDE Java Windows
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wow. that solves it.. thanks a lot.
 
Rob Poulos
Ranch Hand
Posts: 49
  • 0
  • 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
Pie
Posts: 47222
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing forum
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic