JTable table = new JTable(data, columnNames); table.setRowSelectionAllowed(true);
JTable table = new JTable(data, columnNames); table.setRowSelectionAllowed(false);In this example, we create a JTable and call setRowSelectionAllowed(false) to disable row selection. These examples use the javax.swing package library, which is part of the Java standard library for creating desktop GUI applications.