Search code examples
javaswingtooltip

Swing shows empty tooltips, how to disable this?


I'm creating a java Swing app and I'm new to that.

The problem is that when I move cursor to menu item, for example, it shows me an empty tooltip. Is there any way to disable this?

P.S. Using NetBeans, if it's important. Maybe it generated some odd code?


Solution

  • Go to the properties of the menu or menu item that displays the empty tooltip and choose tooltip. Then add "null" as a String value for setTooltipText. The empty tooltip will then dissapear.

    enter image description here

    If the toolTipText property in the designer is bold (changed), you can just press the Reset to Default button at the bottom of the above window, or even right-click on said property in the list and select Restore Default Value.