Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-21-2008, 03:21 PM
Member
 
Join Date: Jan 2008
Posts: 7
ismailsaleh is on a distinguished road
add JToolTip on focus gained forJTextField
Hiiii,
how can i show a tooltip when focus gained on jtextField.

thnx
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-21-2008, 09:24 PM
Member
 
Join Date: Jan 2008
Posts: 3
teracomp is on a distinguished road
textField.setToolTipText("some text goes here");


See:
How to Use Tool Tips (The Java™ Tutorials > Creating a GUI with JFC/Swing > Using Swing Components)
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 01-23-2008, 02:17 PM
Member
 
Join Date: Jan 2008
Posts: 7
ismailsaleh is on a distinguished road
thnx
thnx man, but what i need is when i set focus to text field it takes a time to display the tooltip and i want describe the case for u:
i have a jtextfield when i set focus into it i want to show tooltip thta shows a description about it and i don't want to disappear that tooltip until the focus lost from the jtextfield .

thnx
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 01-24-2008, 02:24 AM
Senior Member
 
Join Date: Jul 2007
Posts: 1,266
hardwired is on a distinguished road
You can make up a JWindow and add a label with your text to it. Set the background of the JWindows contentPane to
UIManager.getColor("ToolTip.background").
Add a FocusListener to the textField. On focusGained you can set the location of the tooltip relative to the textField with
Point p = ((JTextField)e.getSource()).getLocation();
from inside the method. Show the JWindow. Set it not-visible in focusLost.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 01-27-2008, 03:49 PM
Member
 
Join Date: Jan 2008
Posts: 7
ismailsaleh is on a distinguished road
thnx
thank u for ur .
help its works fine now, thnx
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 02-01-2008, 09:51 AM
Member
 
Join Date: Feb 2008
Posts: 9
roshithmca is on a distinguished road
how to create tooltip over a sphere in java 3d....??

if anyboby know...

Roshith.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 02-01-2008, 02:02 PM
Member
 
Join Date: Feb 2008
Posts: 9
roshithmca is on a distinguished road
Quote:
Originally Posted by ismailsaleh View Post
Hiiii,
how can i show a tooltip when focus gained on jtextField.

thnx
JTextField nam = new JTextField();
nam.setToolTipText("Tollllll");

Roshith
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


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

vB 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
how to focus to another JTextfield? birdofprey AWT / Swing 2 04-09-2008 03:08 PM
JTable Focus Traversal helios_lie AWT / Swing 1 12-20-2007 12:27 PM
set focus to the textfield paty New To Java 1 07-24-2007 02:32 AM
Focus Marty AWT / Swing 1 05-31-2007 04:16 AM


All times are GMT +3. The time now is 03:13 PM.


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