List of utility methods to do JList Item Move
boolean | canMoveDown(JList list) checks whether the selected items can be moved down boolean result; int[] indices; result = false; indices = list.getSelectedIndices(); if (indices.length > 0) { if (indices[indices.length - 1] < list.getModel().getSize() - 1) result = true; return result; |
void | moveHome(JList list) move Home list.setSelectedIndex(0); list.ensureIndexIsVisible(0); |
void | movePageUp(JList list) move Page Up int visible = getVisibleRowCount(list); ListSelectionModel selectionModel = list.getSelectionModel(); if (visible <= 0) { moveHome(list); return; int size = list.getModel().getSize(); int decrement = visible - 1; ... |