Search code examples
javaswingtooltip

JButton mouse over motion listener small info frame (Tooltip)


I need to add a box like this to my JButton when the mouseMotionListener is active:

enter image description here

However, I don't know what the name of this box is in Java Swing.

Does anyone know what the declaration name is for this?


Solution

  • Assume that your JButton name is 'button' so button.setToolTipText("Your text here"); will do the trick.