Java JTable Select invertSelection(JTable table)

Here you can find the source of invertSelection(JTable table)

Description

invert Selection

License

Open Source License

Declaration

public static void invertSelection(JTable table) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import javax.swing.*;

public class Main {
    public static void invertSelection(JTable table) {
        for (int rowCount = table.getRowCount() - 1; rowCount >= 0; rowCount--) {
            if (table.isRowSelected(rowCount)) {
                table.removeRowSelectionInterval(rowCount, rowCount);
            } else {
                table.addRowSelectionInterval(rowCount, rowCount);
            }/*  w ww .j  a  v a  2s . co  m*/
        }
    }
}

Related

  1. disableSelection(JTable table)
  2. getSelectedCase(JTable table)
  3. getSelectedObject(JTable table)
  4. getSelectionBackground(JTable t)
  5. invertSelect(JTable table)
  6. moveSelectionDown(JTable table)
  7. selectPositions(final JTable table, final int index0, final int index1)
  8. spaceSelection(final JTable jTable)