This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes what kind of action listener will i apply to this Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "what kind of action listener will i apply to this" Watch "what kind of action listener will i apply to this" New topic
Author

what kind of action listener will i apply to this

Roldan Baldo
Ranch Hand

Joined: Aug 11, 2009
Posts: 99
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

Joined: Oct 27, 2005
Posts: 19651
    
  18

You're calling setName, but it's the setText method that will change the caption of the label.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Roldan Baldo
Ranch Hand

Joined: Aug 11, 2009
Posts: 99
wow. that solves it.. thanks a lot.
Rob Poulos
Ranch Hand

Joined: Aug 21, 2009
Posts: 49
you are calling label.setName(word);

you need to call label.setText(word);


SCJA, ITIL V3 Foudation, Studying for SCJP6
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37943
    
  22
Moving to Swing forum
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what kind of action listener will i apply to this
 
Similar Threads
JFrame problem
how to display textfield in a gridbaglayout
keylistener in a custom component
GridBagLayout question
How can I diplay and Applet on a swing application?