ui/src/main/java/ucar/nc2/ui/table/HidableTableColumnModel.java
@Override
    public void moveColumn(int oldIndex, int newIndex) {
        if ((oldIndex < 0) || (oldIndex >= getColumnCount()) ||
                (newIndex < 0) || (newIndex >= getColumnCount()))
            throw new IllegalArgumentException("moveColumn() - Index out of range");

        TableColumn fromColumn = tableColumns.get(oldIndex);
        TableColumn toColumn = tableColumns.get(newIndex);

        int allColumnsOldIndex = allTableColumns.indexOf(fromColumn);
        int allColumnsNewIndex = allTableColumns.indexOf(toColumn);

        if (oldIndex != newIndex) {
            allTableColumns.removeElementAt(allColumnsOldIndex);
            allTableColumns.insertElementAt(fromColumn, allColumnsNewIndex);
        }

        super.moveColumn(oldIndex, newIndex);
    }
@Override
    public void moveColumn(int oldIndex, int newIndex) {
        if ((oldIndex < 0) || (oldIndex >= getColumnCount()) ||
                (newIndex < 0) || (newIndex >= getColumnCount()))
            throw new IllegalArgumentException("moveColumn() - Index out of range");

        TableColumn fromColumn = tableColumns.get(oldIndex);
        TableColumn toColumn = tableColumns.get(newIndex);

        int allColumnsOldIndex = allTableColumns.indexOf(fromColumn);
        int allColumnsNewIndex = allTableColumns.indexOf(toColumn);

        if (oldIndex != newIndex) {
            allTableColumns.removeElementAt(allColumnsOldIndex);
            allTableColumns.insertElementAt(fromColumn, allColumnsNewIndex);
        }

        super.moveColumn(oldIndex, newIndex);
    }
@ Override public void moveColumn ( int oldIndex , int newIndex ) { if ( ( oldIndex < 0 ) || ( oldIndex >= getColumnCount ( ) ) || ( newIndex < 0 ) || ( newIndex >= getColumnCount ( ) ) ) throw new IllegalArgumentException ( "moveColumn() - Index out of range" ) ; TableColumn fromColumn = tableColumns . get ( oldIndex ) ; TableColumn toColumn = tableColumns . get ( newIndex ) ; int allColumnsOldIndex = allTableColumns . indexOf ( fromColumn ) ; int allColumnsNewIndex = allTableColumns . indexOf ( toColumn ) ; if ( oldIndex != newIndex ) { allTableColumns . removeElementAt ( allColumnsOldIndex ) ; allTableColumns . insertElementAt ( fromColumn , allColumnsNewIndex ) ; } super . moveColumn ( oldIndex , newIndex ) ; }
Moves the column from <code>oldIndex</code> to <code>newIndex</code>.
Posts  <code>columnMoved</code> event.
Will not move any columns if <code>oldIndex</code> equals <code>newIndex</code>.

@throws IllegalArgumentException if either <code>oldIndex</code> or
<code>newIndex</code>
are not in [0, getColumnCount() - 1]
@param    oldIndex            index of column to be moved
@param    newIndex            new index of the column
Moves the column from <code > oldIndex< / code > to <code > newIndex< / code > . Posts <code > columnMoved< / code > event . Will not move any columns if <code > oldIndex< / code > equals <code > newIndex< / code > .