title: How to set the background of tooltip in Swing?
body: <p>I am developing a Swing application in which I need to show the tooltip for JTree nodes. The nodes represent certain tasks and run in an independent threads sequentially. I need to change the tooltip as per the current status of the tasks.</p>
  
  <p>I overrode getToolTipText(MouseEvent e) method in a class that extends JTree. This shows a tooltip too, but the look &amp; feel of the tooltip of other components in my application is different than what is shown for Jtree nodes.</p>
  
  <p>Please see the attached image of a desired  look &amp; feel of the tooltip. This tooltip is set on JTabbedPane.
  <img src="https://i.stack.imgur.com/IfMFH.jpg" alt="enter image description here"></p>
  
  <p>And here is the screenshot of the tooltip that is being displayed on Jtree:
  <img src="https://i.stack.imgur.com/oQMBi.jpg" alt="enter image description here"></p>
  
  <p>I tried html tags but that doesn't work. I also tried setting the look &amp; feel of Jtree node tooltip by using following code, but this doesn't work either. The color codes I used below are same as the ones shown in desired tooltip above:</p>
  
  <pre><code>UIManager.put("ToolTip.background", new ColorUIResource(255, 247, 200)); // The color is #fff7c8.
  Border border = BorderFactory.createLineBorder(new Color(76,79,83)); // The color is #4c4f53.
  UIManager.put("ToolTip.border", border);
  </code></pre>
  
  <p>Can someone please tell me how can I set my JTree tooltip as shown in a desired image above?</p>