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