Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

change textfont in specified rows/elements in a JList

Thread view: 
Tom - 03 Oct 2005 03:38 GMT
Hi,

I have a JList and i want some of it's rows/elements to show in a different
font(i.e bold) than the rest. Can you change the output text looks to specified
elements in the JList? How?

Best regards
Tom
Roedy Green - 03 Oct 2005 04:40 GMT
>I have a JList and i want some of it's rows/elements to show in a different
>font(i.e bold) than the rest. Can you change the output text looks to specified
>elements in the JList? How?

read the docs in JList on using a ListCellRenderer.  Are you sure you
mean JList not JTable?

If you meant JTable, you want to write a TableCellRenderer.

You might want to read the chapter in a Swing book on these beasts.

The crucial fact to keep in mind is that the default JLabel component
you render is the same for all cells, so any changes you make to it
will reflected in all other cells. In other words, set ALL the
attributes you change for any cell.

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.