/** List results by alphabetical name */ private void listByProgramName() { int nresult = datasets.size(); String res[] = new String[nresult]; for (int i = 0; i < nresult; i++) res[i] = (String) datasets.getElementAt(i); Arrays.sort(res); datasets.removeAllElements(); for (int i = 0; i < nresult; i++) datasets.addElement(res[i]); }
public String[] getNames() { String[] names = new String[table.size()]; names = table.keySet().toArray(names); Arrays.sort(names); return names; }
/** sorts the user list and rebuilds the user list from the sorted user vector, */ public void updateList() { Object[] tmp = users.toArray(); Arrays.sort(tmp); userList.setListData(tmp); }