Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Disable multiselect in JTable

Posted on 2000-04-29
2
Medium Priority
?
3,571 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 80 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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 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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Suggested Courses

782 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