Solved

Disable multiselect in JTable

Posted on 2000-04-29
2
3,147 Views
Last Modified: 2012-06-21
How to disable the selection of multiple rows in a JTable?
0
Comment
Question by:Mindo
2 Comments
 
LVL 3

Accepted Solution

by:
terajiv earned 20 total points
ID: 2761932


protected  boolean
                 cellSelectionEnabled
                           If this is true, then both a row selection and a column selection can be non-empty at the same time,
                 the selected cells are the the cells whose row and column are both selected.

protected  boolean               rowSelectionAllowed
                           Row selection allowed in this table

Use avove 2 field or
just use the following..

void
                 setColumnSelectionAllowed(boolean flag)
                           Sets whether the columns in this model can be selected.

or even this

 void setSelectionMode(int selectionMode)
Sets the table's selection mode to allow only single selections, a single contiguous interval, or multiple intervals.
0
 
LVL 2

Author Comment

by:Mindo
ID: 2762013
Works fine.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
egit plugin on eclipse 8 95
even odd program using while loop 3 72
jboss wildfly 10.1 10 405
hashmap order 17 40
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question