Java – how to display a temporary balloon tooltip during input validation?
•
Java
I'm a little used to Gui idioms. When I input an error in the text input field, a balloon pops up from the field, with information about what error / expected input I have It remains visible until I type it again
Given a jtextfield, do you know any library / code that will display such a balloon when my keylistener is triggered?
@see http://www.javapractices.com/topic/TopicAction.do?Id=151
Solution
Balloon tip is a library:
balloonTip = new BalloonTip(f,"Tooltip msg");
All this is needed! If you insist on a tooltip:
tooltipBalloon = new BalloonTip(someComponent,"I'm a balloon tooltip!"); // Now convert this balloon tip to a tooltip,such that the tooltip shows up after 500 milliseconds and stays visible for 3000 milliseconds ToolTipUtils.balloonToToolTip(tooltipBalloon,500,3000);
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码