0

I want to create a tool tip which has fix rectangular size and show custom font's...
Any tips or link or any material to start with?

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by mKorbel
2

You can subclass JToolTip to create a custom appearance etc, then subclass the control in question to override its public JToolTip createToolTip() method (inherited from JComponent) to return an instance of your customised JToolTip subclass.

0
UIManager.put("ToolTip.foreground", new ColorUIResource(Color.WHITE));
		UIManager.put("ToolTip.background",new ColorUIResource(176,23,31));
		UIManager.put("ToolTip.font",	new FontUIResource(Font.SANS_SERIF,Font.BOLD,16));

We can use to change fonts , fore groud, background and border without sub classing JToolTip...
Just Write before setting ToolTip for any component.

Edited by Majestics: n/a

0

that really wrong way, but in other hands works too, but for whole JVM instance

post by @JamesCherrill goes another direction, then could it be same as you set any methotds for JLabel, JPanel ....

that isn't Custom JToolTip, just override vanilla UI

Edited by mKorbel: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.