TableRowSorter « JTable « Java Swing Q&A





1. JTable RowFilter    stackoverflow.com

Is is possible to some how get the index of the selection corresponding to the non filtered table? After the table is filter using a regexFilter. JTable getSelectedRow returns the index of ...

2. Removing rows from a DefaultTableModel with a RowSorter attached doesn't remove last row    stackoverflow.com

I'm somewhat new to Java, and especially new to tables, and I'm having a bit of trouble with one particular task. I have a JTable that uses a custom table model that ...

3. Updating a JTable after using RowFilter    stackoverflow.com

I was able to attach a filter to the GraphTable (which is extended from the JTable). I was trying out a sample filter which filters all the rows starting with the ...

4. Sorting JTable Rows manually and with TableRowSorter simultaneously    stackoverflow.com

I have to create a table that can be sorted by clicking on the table header AND by reordering single and multiple rows by hand. I made some buttons to move selected ...

5. TableRowSorter and RowFilter - searching visible and rendered columns    stackoverflow.com

I am using TableRowSorter and RowFilter for filtering data in a JTable. I have come across 2 issues while using it. 1) My table has visible and hidden columns. I would like ...

6. Why won't my TableRowFilter filter?    stackoverflow.com

I'm trying to filter a JTable using a TableRowFilter . It works for me on a simple example , but I can't seem to get it to work on the real ...

7. Why is TableRowSorter messing up my results?    stackoverflow.com

I have a JTable to which I linked a DefaultTableModel and a TableRowSorter. They work. When you click in a row, its content is copied to JTextfields so you can edit ...

8. After adding a TableRowSorter adding values to model cause java.lang.IndexOutOfBoundsException: Invalid range    stackoverflow.com

After adding a TableRowSorter to a table and its corresponding model any corresponding adds specifically at firetabletablerowsinserted cause exceptions. It is clear from testing that the GetRowCount() is returning a value ...

9. JTable TableRowSorter or Re-query MySQL DB?    stackoverflow.com

Using JDBC and MySQL I am displaying a MySQL table in a JTable. Currently as soon as my Java application is launched the Database table is being queried for all results (e.g. ...





10. JTable Sorting based on hidden column    stackoverflow.com

I would like to sort JTable rows based on one hidden column. Say I have a JTable like this

column1   column2
val1       val2
Now I have a ...

11. Sorting double values in JTable (SOLVED)    stackoverflow.com

I have found quite a few questions related to this but I haven't found a simple solution to my issue though. I can't find a way to make my JTable sort Double ...

12. Is it possible to invoke the auto row sorter in a jtable    stackoverflow.com

is there anyway to invoke the auto row sorter in a jtable that is created by using

setAutoCreateRowSorter(true);
i'm trying to get it to sort by a default column without the user having ...

13. using TableRowSorter    coderanch.com

public class OrdenaUtil implements Comparator { public int compare(Object este, Object aquele) { int comparacao = 0; int nEste = Integer.parseInt((String)este.toString()); int nAquele = Integer.parseInt((String)aquele.toString()); if (nEste == nAquele) comparacao = 0; else if (nEste < nAquele) comparacao = -1; else comparacao = 1; return comparacao; } } //... FornecedorAlunos fornecedor = FornecedorAlunos.getFornecedor(); fornecedor.obtemRs(); TableModelAlunos model = TableModelAlunos.getModel(); getJTableAlunosPautaAlunoTurma().setModel(model); TableRowSorter trs ...

14. TableRowSorter slow?    coderanch.com

15. TableRowSorter issue    coderanch.com

import java.util.List; import java.util.Vector; import javax.swing.JTable; import javax.swing.SwingWorker; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.AbstractTableModel; import javax.swing.table.TableModel; import com.edex.model.AbdEmployeeDAO; import com.edex.vo.AbdEmployee; import com.edex.vo.Data; import com.edex.vo.EmployeeItem; import com.tables.TableModelDemo2.SimpleTableModel2; public class SimpleTableModel extends AbstractTableModel { private static AbdEmployeeDAO empDAO = new AbdEmployeeDAO(); private String[] columnNames = { "Index", "FirstName", "MiddleName","LastName" }; private Class[] columnTypes = { Integer.class, String.class,String.class, String.class }; private static Vector dataVector; ...

16. Jtable + TableRowSorter    java-forums.org

Jtable + TableRowSorter Hi * i am currently facing this problem: if u select a row in the table and finally sort the table the coloured row will not stay on the selected one but will jump to different ones. if i comment out the method getSelectedRows (only use the super call) it will work for SINGLE_SELECTION, but for ...





17. TableRowSorter, explicit comparator is not working    java-forums.org

TableRowSorter, explicit comparator is not working Hi guys I've got a problem with the TableRowSorter. Cotext is this: I'd like to set up an explicit comparator for one of the columns of a JTable. In the customized table model I've got, I cannot override the getColumClass in my table model, so I need to specify an ad-hoc comparator. Problem's ...

18. TableRowSorter, HeaderRenderer and LAF    java-forums.org

public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component c = defaultRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (c instanceof JLabel) { JLabel label = (JLabel) c; this.mark = (Icon) label.getIcon(); removeAll(); ... ... .... String[] header = ((String) value).split("\n"); setLayout(new GridLayout(header.length, 1)); for(String s: header){ label1 = new JLabel(s,(Icon) this.mark,JLabel.CENTER); label1.setHorizontalTextPosition(JLabel.LEFT); add(label1); } ...