I have the problem that the JTable that I fill myself with data and want to autosort it using the interface. However it gets sorted as Strings, so 10 comes after 2. How can i fix that?
public class GUI extends Frame implements ActionListener, WindowListener {
private static final long serialVersionUID = -693036000167528691L;
private Button run,findAll,sortByNumberOfStretchesFound, sortByLongestStretch;
private TextField selectionSizeStart, numberOfThreads, selectionSizeEnd, minimumStretchSize, sequence;
private JTable table;
private String[] columnNames = new String[]{"#","Label","Label-Length","#Stretches Found","Unique","Longest Stretch"};
private int sortBy = 3;
private Object[][] data;
public GUI(String defaultSequence, int defaultSelectionMinimumSize, int defaultNumberOfThreads) {
table = new JTable(new DefaultTableModel(columnNames,0));
table.setAutoCreateRowSorter(true);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
JScrollPane scrollbar = new JScrollPane(table);
setLayout(new FlowLayout());
setVisible(true);
}