Swing : communication/events between components

Discussion in 'Java' started by Marcos, Jan 12, 2006.

  1. Marcos

    Marcos Guest

    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
    Marcos, Jan 12, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mickey Segal
    Replies:
    0
    Views:
    855
    Mickey Segal
    Feb 2, 2004
  2. T E Schmitz
    Replies:
    3
    Views:
    410
  3. mkrause
    Replies:
    0
    Views:
    661
    mkrause
    May 6, 2005
  4. JavaEnquirer
    Replies:
    3
    Views:
    441
    Monique Y. Mudama
    Jan 27, 2006
  5. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    338
    Chris
    Aug 30, 2005
Loading...

Share This Page