🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12482

Re: Tooltip Text Color

#12482
From: John Zukowski
Date: Sun, 13 Dec 1998 00:00
45 lines
1793 bytes
C.Smith wrote:
> 
> I am using the Metal UI and the default color for the tooltiptext setting is
> purple. Is there a way to change this, and if so, how?
> 
> Thanks,
> C.Smith

Just set the UIDefaults for the background of the tooltip...

	J

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class TooltipSample {

  public static void main(String args[]) {

    JFrame frame = new JFrame("Tooltip Colors");

    UIDefaults defaults = UIManager.getDefaults();
    defaults.put("ToolTip.background", Color.yellow);

    JButton button = new JButton ("Yellow");
    button.setToolTipText("Hi");

    Container c = frame.getContentPane();
    c.add(button, BorderLayout.CENTER);

    frame.setSize(350, 250);
    frame.setVisible(true);
  }
}

-- 
public class jaz extends JohnZukowski implements MageLangInstitute {
  Email    jaz@ultranet.com || jaz@magelang.com ;
  Webpage  http://www.magelang.com || http://java.miningco.com ;
  Author   Borland_JBuilder_No_Experience_Required ;
  Webpage  http://www.sybex.com/cgi-bin/nxr_new.pl?2135 ;
  Author   Java_AWT_Reference ;
  Webpage  http://www.ora.com/catalog/javawt/ ;
} throws GeneralPieFaultException ;
Technical Details
Message-ID: <3673512D.3172@zukowski.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <74kgei$ahv16@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,22a83ead09479568
X-Google-Attributes: gid111d45,public
From: John Zukowski <jaz@zukowski.net>
Subject: Re: Tooltip Text Color
Date: 1998/12/13
Message-ID: <3673512D.3172@zukowski.net>
X-Deja-AN: 421713767
Content-Transfer-Encoding: 7bit
References: <74kgei$ahv16@forums.borland.com>
To: "C.Smith" <chads@cybertron.com>
Content-Type: text/plain; charset=us-ascii
Organization: MageLang Institute - http://www.MageLang.com
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing