Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A JButton on mouse pressed method that would modify the JButton text



On Thursday, Jul 31, 2003, at 21:06 US/Pacific, email@hidden wrote:

Hi - I have been searching the Java Documentation looking for a JButton on mouse pressed method that would modify the JButton text. Just like the: setPressedIcon() gives an on press state for a button icon does such a method exist for JButton text?

Why do I get the impression that you're still pretty new to Swing? You may get more mileage out of http://java.sun.com/docs/books/tutorial/uiswing/ than posting a bunch of questions here. Just a thought. ;-)

To answer your question, you'd want to register a MouseListener on the JButton in question, and then implement the appropriate methods. You can find all the details by following the link above.

Cheers!
Andrew Miner
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.