Solved

Disable multiselect in JTable

Posted on 2000-04-29
2
3,029 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
topping2 challenge 13 91
HTTPSessionBindingListernter not configured in deployment descriptor 2 53
hibernate example for saving data 19 39
CSV file parsing thru Java 13 31
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

770 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