File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Quetion about Changing labels on Buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Quetion about Changing labels on Buttons" Watch "Quetion about Changing labels on Buttons" New topic

Quetion about Changing labels on Buttons

Avin Sinanan

Joined: Nov 06, 2001
Posts: 7
Ok here are the requirements
1)There is a button on a JPanel which says "Click Me".
2)When You Click it the button displays "Thank you for clicking".
3)When it has been clicked not only does teh label on the button change but a message jus below the button is displayed .. something like " You have just pressed the Button".
can anyone show me how to do this?
Thank you for giving this a read...
Thanks for reading

thank you

Yours Respectfully<br />Avin Sinanan
Michael Ernest
High Plains Drifter

Joined: Oct 25, 2000
Posts: 7292

This is a real fast quick-and-dirty. I don't know if it will compile but it should be close. There should also be enough here for you to play around with your requirements a little more.

If the compiler really bombs let me know what error you get.
Also, please see your other post with regard to JavaRanch's naming policy.
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Sean MacLean
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
I agree. Here's the link:
subject: Quetion about Changing labels on Buttons
It's not a secret anymore!