Javatpoint Logo
Javatpoint Logo

How to use ToolTip in Java Swing

You can create a tool tip for any JComponent with setToolTipText() method. This method is used to set up a tool tip for the component.

For example, to add tool tip to PasswordField, you need to add only one line of code:


Simple ToolTip Example

Output:

Java How to use tool tip 1




Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA