M
Marcos
I'm new to Swing, and need to get something working pretty quickly.
Basically, I have a table and I want to sort when I click on the
headers (done) and filter acording to some text (so if I type in, say,
'Foo' I only get rows where a particular column matches or starts with
that value). So my questions are
1) I want to be able to have a filter on every column, so I opted for
another JTable on top of main one, just with the same number of columns
and no TableModel. Is there another way? The only problem I can see
with it is that when the main table gets too long, a scroll bar appears
(which I want), but then the 'filter' table cells no longer match up
with the main table (as the main table squashes up slightly)
2) The biggest problem I have is how to do something on the main table
when a KeyPress event happens on the filter table? I can't find any
example on the net. So, when I type 'Foo' in JTable 'filter', I want to
be able to filter the results shown in the JTable 'main', for the same
column index as the one where the text was typed in...
3) Am I going about this all wrong? Is there another way?
Marcos
Basically, I have a table and I want to sort when I click on the
headers (done) and filter acording to some text (so if I type in, say,
'Foo' I only get rows where a particular column matches or starts with
that value). So my questions are
1) I want to be able to have a filter on every column, so I opted for
another JTable on top of main one, just with the same number of columns
and no TableModel. Is there another way? The only problem I can see
with it is that when the main table gets too long, a scroll bar appears
(which I want), but then the 'filter' table cells no longer match up
with the main table (as the main table squashes up slightly)
2) The biggest problem I have is how to do something on the main table
when a KeyPress event happens on the filter table? I can't find any
example on the net. So, when I type 'Foo' in JTable 'filter', I want to
be able to filter the results shown in the JTable 'main', for the same
column index as the one where the text was typed in...
3) Am I going about this all wrong? Is there another way?
Marcos