By Alvin Alexander. Last updated: June 4, 2016
Java/Swing FAQ: How do I set the help text (i.e., help text, balloon text, tooltip text) on a JButton?
Just call the setToolTipText
method on the JButton
. Here's a quick JButton tooltip display example:
// create a button with tooltip help text JButton button = new JButton("Click Me"); button.setToolTipText("Click this button to make something happen.");