自分でデータを入力したJTableが、インターフェイスを使用して自動ソートしたいという問題があります。ただし、文字列として並べ替えられるため、2の後に10が続きます。どうすれば修正できますか?
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);
}