Here you can find the source of disableSelection(JTable table)
public static void disableSelection(JTable table)
//package com.java2s; //License from project: Open Source License import javax.swing.*; public class Main { /**/*from w w w . j a va 2 s. c o m*/ * Disable any selections on a table. */ public static void disableSelection(JTable table) { table.setRowSelectionAllowed(false); table.setColumnSelectionAllowed(false); table.setCellSelectionEnabled(false); table.setFocusable(false); } }