public void actionPerformed(ActionEvent e){
int selectedIndex = sortFieldsList.getSelectedIndex();
if (selectedIndex >= 0 && selectedIndex < sortListModel.getSize() - 1) {
// Remove the item from the list and insert it at the next position.
Object item = sortListModel.remove(selectedIndex);
sortListModel.insertElementAt(item, selectedIndex + 1);
// Reselect an appropriate item in the list.
sortFieldsList.setSelectedIndex(selectedIndex + 1);
}
}