List of utility methods to do JList Element 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; |
boolean | canMoveUp(JList list) checks whether the selected items can be moved up boolean result; int[] indices; result = false; indices = list.getSelectedIndices(); if (indices.length > 0) { if (indices[0] > 0) result = true; return result; |