This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm working on JTable and database when I've encountered this issue, when I wanted to freeze the first columns of my JTable that contains names and similar information.
When I tried and asked our bestfriend google how to do it, he told me to use JScrollPane's setRowHeaderView(Component view) method, which pretty much deals with my situation.
I managed to setup two different tables and yeah, its cool. However, I noticed that the JTable I've set as the component of the RowHeaderView doesn't display its Column Headers and only displays gray.
Is there any way where I can make its Column Headers appear? Or do I have to look for some other ways to implement freezing of JTable columns?
from memory, you'd create 2 tables:
table1 has only a single column, goes in BorderLayout.WEST (will have default header 'A')
table2 has all the rest, with column 0 removed, in BorderLayout.CENTER (default headers 'B' to whatever)
a bit of sync-ing the scrollbar and selection models and it should work fine