2

I have added the line to set look and feel to system. This is found to work because the scroll bars have changed.

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

But when I set a tooltip to my JTabbedPane's tab, it does not show the system's look and feel for tooltips. Why is this? Screenshots are below.

System's look and feel:

enter image description here

Java's look and feel(?):

enter image description here

I want to set my tooltip to look like the system's which is in the first screenshot. How do I do this?

mKorbel
  • 109,525
  • 20
  • 134
  • 319
Matt
  • 41
  • 1
  • 4

1 Answers1

2

Much work without the complete effect:

  • for getting the background you need a custom implemenation of ToolTipUI: basically extend BasicToolTipUI and take over the painting
  • register the custom ui delegate with the UIManager so that it is used instead of the default
  • theoretically, you can achieve the rounded corners of the window (the one containing the tooltip) by using a shaped window (public api in jdk7, a half-official workaround available for jdk6), you would need a shaped window. Practically, there is no way (except extreme hacking) to make the ToolTipManager use that window
kleopatra
  • 51,061
  • 28
  • 99
  • 211