Mike Adler
Mike Adler

Reputation: 1200

Disable Swing Tooltips by Command Line Parameter

Is there a way to disable Tooltip display in Swing application (JRE6+, Motif look and feel) without changing the source code?

I have a rolled-out application that, in one instance, has severe display problems when tooltips on JTable are displayed. Essentially, the entire table wants to repaint and due to some other problems the repaint is slow enough to present severe flickering. For an immediate workaround, I cannot change the rolled out jars. The only solution I can imagine right now would be to find a property I can set from command line that disables tooltips or at least significantly increases the initial and reshow delays.

Is there any such property?

Upvotes: 1

Views: 328

Answers (1)

Sergiy Medvynskyy
Sergiy Medvynskyy

Reputation: 11327

See the class ToolTipManager. You can disable all the tooltips in your application. So you need a new jar with one little class which provide a proxy to your target jar.

Something like this:

public class ProxyLauncher {
    public static void main(String[] args) {
        ToolTipManager.sharedInstance().setEnabled(false);
        // launch your application:
        // MyApplication.main(args);
    }
}

Upvotes: 3

Related Questions