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 / GUI / September 2007

Tip: Looking for answers? Try searching our database.

JTable (setForeground on text in cell)

Thread view: 
:-o - 23 Sep 2007 15:25 GMT
Thanks,

Based on Events/conditions , I need to set the text in a JTable cell from
default color (black) to background color (white) to "hide" the text.  These
conditions will force back/forth to the foreground coloring.

Is any one cell containing text a JTextField or JLabel?

How would I get a reference to the component to make the setForeground() call.

Thanks again.....
Andrew Thompson - 23 Sep 2007 17:42 GMT
:-o wrote:
..
>Based on Events/conditions , I need to set the text in a JTable cell from
>default color (black) to background color (white) to "hide" the text.  

You best bet is to implement your own
javax.swing.table.TableCellRenderer, but note
that it would probably be better to simply have
the returned component contain an empty String,
based on 'Evensts/Conditions' otherwise if the
user selects the cell/text, the text will become visible.

Signature

Andrew Thompson
http://www.athompson.info/andrew/



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.