JTable selected cell highlight

Hi,

I want to reproduce Excel behaviour in a JTable :

highlight the cell on which user has clicked once

show the caret when the user has double-cliked on it.

The second behaviour looks like being built-in the JTable

But when the user clicks once on the cell not visual effect appears

to reflect the click event.

I would like to have the selected cell "border" painted in another color.

Would you have a hint for that ?

thanks

[486 byte] By [hpsmartyz] at [2007-9-30 17:57:51]
# 1
Use CellRenderer...gr. Razorblade
Razor_Blade at 2007-7-6 18:26:52 > top of Java-index,Java Essentials,Java Programming...
# 2

Thanks you the hint Razor_Blade.

could you elaborate a bit more please.

I don't feel like getting deep into rendering stuff now,

and was expecting a simple solution.

But if there's no, don't bother.

It will take the time that it needs but I'll find out.

thx.

hpsmartyz at 2007-7-6 18:26:52 > top of Java-index,Java Essentials,Java Programming...
# 3
see http://java.sun.com/docs/books/tutorial/uiswing/components/tabl.html
Razor_Blade at 2007-7-6 18:26:52 > top of Java-index,Java Essentials,Java Programming...
# 4
Thanks,I know this tuto.
hpsmartyz at 2007-7-6 18:26:52 > top of Java-index,Java Essentials,Java Programming...
# 5
Okay good luck, it's the best i can think of....
Razor_Blade at 2007-7-6 18:26:52 > top of Java-index,Java Essentials,Java Programming...
# 6
Maybe you can find something in the java lookandfeel package...
Razor_Blade at 2007-7-6 18:26:52 > top of Java-index,Java Essentials,Java Programming...
# 7
not sure it's easier.anything else from anyone else ?
hpsmartyz at 2007-7-6 18:26:52 > top of Java-index,Java Essentials,Java Programming...
# 8
OK,finally decided to learn about rendering.Not so complicated finally ;-)thx
hpsmartyz at 2007-7-6 18:26:52 > top of Java-index,Java Essentials,Java Programming...