Hiiii,
how can i show a tooltip when focus gained on jtextField.
thnx
Printable View
Hiiii,
how can i show a tooltip when focus gained on jtextField.
thnx
textField.setToolTipText("some text goes here");
See:
How to Use Tool Tips (The Java™ Tutorials > Creating a GUI with JFC/Swing > Using Swing Components)
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
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.
thank u for ur .
help its works fine now, thnx
how to create tooltip over a sphere in java 3d....??
if anyboby know...
Roshith.