Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #4065

Re: ultimate chalenge in

From "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this>
Subject Re: ultimate chalenge in
Message-ID <nospam-27FA94.06213022082008@aioe.org> (permalink)
Newsgroups comp.lang.java.gui
References <890abd332fe0a@uwe>
Date 2011-04-27 15:48 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
In article <890abd332fe0a@uwe>, "vaidhu" <u45630@uwe> wrote:

[...]
> how do I change the font of individual combo box items, say if I have 
> 5 items in a combo box , how can I have each of them in a different 
> font ? I can do combo.setFont(Font f) but is there any way I can set 
> the font of the combo Items ?
> 
> Also,In my combobox  i want to display more than one item of every 
> font type. I want the source code or logic.
[...]

You might look at this:

<http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html#renderer>

Let MyFontRenderer extend JLabel and implement ListCellRenderer.
Let it contain sufficient data to map the item index to your
desired font. Set the desired font in getListCellRendererComponent().

-- 
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews

---
 * 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

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

ultimate chalenge in JCom "vaidhu" <vaidhu@THRWHITE.remove-dii-this> - 2011-04-27 15:48 +0000
  Re: ultimate chalenge in "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:48 +0000
    Re: ultimate chalenge in "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:48 +0000
      Re: ultimate chalenge in "vaidhu" <vaidhu@THRWHITE.remove-dii-this> - 2011-04-27 15:48 +0000

csiph-web