?
Solved

Setting default row selection color for JTable without using a custom renderer. Can I use setClientProperty

Posted on 2005-03-08
2
Medium Priority
?
268 Views
Last Modified: 2008-02-01
Is there a way to set the default renderer in either the list or table so that the selected row color is yellow? I have seen some examples of using setClientProperty to modify the default display of a JTree. Can I use this? Also, where do i find out all the properties I can set using setClientProperty function.

Thanks,

Anthony
0
Comment
Question by:anthony0007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 13490793
table.setSelectionBackground(Color.yellow);


list.setSelectionBackground(Color.yellow);
0
 

Expert Comment

by:msmsm
ID: 13494249
There is an example on adding icon to an element in Jtree.
To set the background for an element you have tot change the Renderer.
http://www.objects.com.au/java/examples/swing/AnimatedIconTreeCell1.do
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question