mindmaster
mindmaster

Reputation: 1755

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?

Upvotes: 6

Views: 7494

Answers (2)

Costis Aivalis
Costis Aivalis

Reputation: 13728

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.

Upvotes: 7

JB Nizet
JB Nizet

Reputation: 691715

I guess you're using the (now dead) Swing Application Framework. Netbeans automatically generates an entry in the properties file associated with each panel for the tooltip, with an empty value (instead of not generating the property at all if you leave the text box blank). Just remove the property in the properties file manually.

The lines looking like the following should be removed:

someAction.shortDescription=

Upvotes: 2

Related Questions