aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable Columns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable Columns" Watch "JTable Columns" New topic
Author

JTable Columns

tan kian
Ranch Hand

Joined: Apr 24, 2006
Posts: 30
Hi all, does anyone know how to highlight columns when the column header is clicked?
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535

edit: added noFocusBorder to renderer
[ April 25, 2006: Message edited by: Craig Wood ]
tan kian
Ranch Hand

Joined: Apr 24, 2006
Posts: 30
thanks ^_^ i'll try it out and get back to u if i have any questions.
tan kian
Ranch Hand

Joined: Apr 24, 2006
Posts: 30
i tried to do some stuff by myself, but i ran into some problems. i am using JTables to make an Excel-like spreadsheet. first, i cant highlight rows(when i click on the row header) after i put highlight(table) into the code. 2nd, i wanted it to work like this: highlight the entire row/column when i click on the respective header. however, the entire row/column will be highlighted no matter where i click in the table. can someone help? thanks.

[ April 26, 2006: Message edited by: Mr Hamtaro ]
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
tan kian
Ranch Hand

Joined: Apr 24, 2006
Posts: 30
thanks again Craig ^_^ i'll try your code and ask questions about anything i dont understand.
tan kian
Ranch Hand

Joined: Apr 24, 2006
Posts: 30
here are the problems i ran into again. can someone help to explain why? anything i should be/should not be doing? thanks!!!

1)even if an entire column/row is been highlighted, choosing another cell does not make the highlighted column/row return to normal



[ April 29, 2006: Message edited by: Mr Hamtaro ]
[ April 29, 2006: Message edited by: Mr Hamtaro ]
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
tan kian
Ranch Hand

Joined: Apr 24, 2006
Posts: 30
thanks Craig, u've been a great help =)
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
"Mr Hamtaro":



I'm suprised you haven't been called on your name!
tan kian
Ranch Hand

Joined: Apr 24, 2006
Posts: 30
lol well maybe because pple who post here are not here to relax? they come here looking for help and codes
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Originally posted by Mr Hamtaro:
lol well maybe because pple who post here are not here to relax? they come here looking for help and codes


I am just referring to this site's naming policy.
tan kian
Ranch Hand

Joined: Apr 24, 2006
Posts: 30
oh sorry i didnt know that. i'll change my name then.
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
You can still use hamtaro for a profile picture (check out my profile)
[ May 03, 2006: Message edited by: Jeff Albertson ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable Columns
 
Similar Threads
Is it ok to drop the foreign keys created by EJB 3 on the database?
How to find the length of the array
Swing / JFC / AWT
I passed SCJD :)
What is the meaning of data displayed by netstat -a