Java Utililty Methods JList Item Move

List of utility methods to do JList Item Move

Description

The list of methods to do JList Item Move are organized into topic(s).

Method

booleancanMoveDown(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;
voidmoveHome(JList list)
move Home
list.setSelectedIndex(0);
list.ensureIndexIsVisible(0);
voidmovePageUp(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;
...