Esto me funciona como lo podría adaptar, Como podria usar Object[][] data
Código Java:
Ver originalpublic static void main
(String[] args
) { Object[][] data
= { { "A",
5 },
{ "B",
2 },
{ "C",
4 },
{ "D",
8 } }; String columnNames
[] = { "Item",
"Value" }; public Class<?> getColumnClass(int column) {
return getValueAt(0, column).getClass();
}
};
RowFilter
<Object, Object
> filter
= new RowFilter
<Object, Object
>() { public boolean include(Entry entry) {
return population.intValue() > 3;
}
};
TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(model);
sorter.setRowFilter(filter);
table.setRowSorter(sorter);
frame.
setDefaultCloseOperation(JFrame.
EXIT_ON_CLOSE);
for(int row = 0;row < table.getRowCount();row++) {
System.
out.
println(table.
getModel().
getValueAt(table.
convertRowIndexToModel(row
),
0)); }
}
});
frame.
getContentPane().
add(btnNewButton,
BorderLayout.
SOUTH); frame.getContentPane().add(scrollPane);
frame.setSize(300, 200);
frame.setVisible(true);
}