Changing the default color of JToolTips

Use the Swing class UIManager for this and change the keys ToolTip.background and ToolTip.foreground. Here’s an example:

Main.java:

import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.awt.*;
 
public class Main extends JFrame {
   public Main() {
      super("JToolTip Delay Demonstration");
 
      getContentPane().setLayout(new FlowLayout()); 
 
      JLabel label = new JLabel("How was I?");
      label.setToolTipText("too commercial");
 
      UIManager.put("ToolTip.background", Color.red);
      UIManager.put("ToolTip.foreground", Color.yellow);
   
      getContentPane().add(label);
 
      addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
            System.exit(0);
         }
      });
 
      setSize(400, 300);
   }
 
   public static void main(String[] args) {
      Main main = new Main();
      main.setVisible(true);
   }
}