Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-22-2007, 07:28 PM
Member
 
Join Date: Jul 2007
Posts: 4
Rep Power: 0
gradon is on a distinguished road
Default mouse over on JButton
JButton b2 = new JButton ("Joke Break", new ImageIcon ("joke.gif"));
pane.add (b2);
b2.setBounds (25, 40, 125, 25);


b2.addActionListener (new ActionListener ()
{
public void actionPerformed (ActionEvent e)
{



//JokeTxt.setText ();
Joke ();
generateJoke ();



}

}


);

there is the code now i want to make it that when the person wants to click on the Button , when the mouse moves over teh button a message must appear can some1 help me with this
thanks
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 08-04-2007, 06:50 AM
hardwired's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 1,577
Rep Power: 4
hardwired is on a distinguished road
Default
You can set a rolloverIcon (AbstractButton class) for the button and you also have available the JComponent method setToolTipText.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse dragg not working Preethi AWT / Swing 1 02-08-2008 05:51 AM
The mouse and the cheese Don Quixote Java 2D 4 08-15-2007 11:55 PM
How to mouse-drag a JWindow? cruxblack New To Java 3 08-06-2007 10:52 AM
Use the mouse position susan Java Applets 1 07-29-2007 12:10 AM
Mouse over JButton sandor AWT / Swing 1 05-17-2007 10:15 PM


All times are GMT +2. The time now is 12:18 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org