Results 1 to 4 of 4
  1. #1
    itaipee is offline Member
    Join Date
    Dec 2008
    Posts
    99
    Rep Power
    0

    Default Sort and filter in Jtable (java ver 1.5 )

    There is nice guide for JTable here , but the sorter works only for 1.6.
    I am part of project that work with 1.5 , so it does not up to me to update the java. Nevertheless - is there a way to use filters and sorters in jtable?
    ( beside manually, to update the dataModel with my own methods)

    How to Use Tables (The Java™ Tutorials > Creating a GUI with JFC/Swing > Using Swing Components)

  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    7

    Default

    for sorter... you may do it column by column...
    jtable.getColumnModel().getColumn(i).setCellRender er(XXX);

    XXX is object of class which extends others classes implements TableCellRenderer, may be DefaultTableCellRenderer
    Last edited by mtyoung; 04-16-2009 at 01:02 PM.

  3. #3
    itaipee is offline Member
    Join Date
    Dec 2008
    Posts
    99
    Rep Power
    0

    Default I can I make one row invisible without remove the row from the tableModel ?

    jtable.getColumnModel().getColumn(i).setCellRender er(XXX);
    Please , can you verify about the er .. in setCellRender i had to put "TableCellRenderer" - i dont realy know what it is

    Anyway, Another question , I try to filter my self. can I make one row invisible without remove the row from the tableModel ?
    Last edited by itaipee; 04-16-2009 at 12:37 PM. Reason: grammer mistake

  4. #4
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    7

Similar Threads

  1. How to sort a JTable for multiple columns?
    By BLR in forum Advanced Java
    Replies: 2
    Last Post: 03-16-2009, 11:41 AM
  2. Using Merge Sort to sort an ArrayList of Strings
    By coldfire in forum New To Java
    Replies: 3
    Last Post: 03-13-2009, 02:03 AM
  3. How to sort column in JTable
    By johnt in forum AWT / Swing
    Replies: 3
    Last Post: 06-14-2008, 06:48 AM
  4. web content filter or internet filter
    By sundarjothi in forum Advanced Java
    Replies: 3
    Last Post: 05-15-2008, 12:36 PM
  5. sort columns in jtable
    By Alan in forum AWT / Swing
    Replies: 2
    Last Post: 05-14-2007, 06:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •