Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Steve W. Jackson" Subject: Re: Changing the font of Message-ID: X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: <4v2k87F1aosl9U1@mid.individual.net> References: <4v2k87F1aosl9U1@mid.individual.net> Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 45 Date: Wed, 27 Apr 2011 15:27:46 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303918066 96.60.20.240 (Wed, 27 Apr 2011 10:27:46 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:27:46 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:479 To: comp.lang.java.gui In article <4v2k87F1aosl9U1@mid.individual.net>, Thomas Kellerer wrote: > qu0ll wrote on 22.12.2006 10:28: > > Is it possible to change the properties of the font used in displaying tool > > tip text for a JComponent? > > > > You could override createToolTip() and then set the Font: > > public JTooltip createToolTip() > { > JToolTip tip = super.createToolTip(); > tip.setFont(myFont); > return tip; > } > > haven't tried this though. > > > If you want to change it globally, you can do this by applying the necessary > UIDefaults *before* creating the first Swing Component. > > UIDefaults def = UIManager.getDefaults(); > def.put("ToolTip.font", myFont); > > Thomas As to the UIDefaults part, I'm pretty sure I've read that the preferred way of doing what's suggested here would be to use a FontUIResource rather than a Font. The former subclasses the latter, and its API Javadoc description says that "UI classes which set default font properties should use this class." It has constructors accepting a Font or the name, style and size as can be used with a Font. = Steve = -- Steve W. Jackson Montgomery, Alabama --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24