By Alvin Alexander. Last updated: June 4, 2016
Java JLabel FAQ: How do I set the help text (i.e., help text, balloon text, tooltip text) on a JLabel?
Just call the setToolTipText
method on the JLabel
. Here's a quick JLabel tooltip display example:
// create a label with tooltip help text JLabel label = new JLabel("Username"); label.setToolTipText("Enter your username");