Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
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
?
273 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
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
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:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month12 days, 8 hours left to enroll

580 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