posted 12 years ago
Yes, exactly, sorry that I forgot to mention that; I am indeed referring to an Excel-like "freeze pane" functionnality.
The idea is that my customer would like to get a couple of columns at the start of the JTable which don't scroll, while the rest of the table does. And since I've barely ever worked with viewports and the likes (well, I'm not even sure if that's really the mechanism at work), and heard a couple of times that it is quite a tedious work to implement that myself (at least in a non-buggy way) and my time-budget is not too high, I'd prefer to avoid that, if possible (even if it means using a commercial library).
@Darryl: what I tried so far is something I found over the internet. It consists in having two tables next to each other that share the same model. The "scrollable table'''s column model is stripped from all the unrelevant columns, while they are added to the "fixed table", and then the "fixed table" is set as the row header of the "scrollable table".
I thought this solution rather satisfying, but unless I missed some subtelty, I didn't find a way to do mouse-selections over both tables at the same time, and sadly my customer really wants that.
For instance, if I have a "fixed table" with two columns and a "scrollable table" with 5 columns, the customer would like to have the possibility to select with the mouse (or even keyboard) data from column 2, 3 and 4. In the tries I performed with this implementation, it is not possible (if the selection starts on table 1, I can select only the 2nd column because that's the last column of table 1 ; if I start on table 2, I can select only columns 3 & 4, because they're the first columns of table2).
Sadly, I didn't find a way to do that, but since that's a topic i'm not familiar with, it might be I missed something really simple there? If not, any known library/piece of code that does this or even any hint toward which mechanisms to search on (ex: viewports, and others if there are other things at work) would be a great help!
---------------
(below the latest implementation I tried, as found on some website (maybe even here, I don't remember))