Solved

Disable multiselect in JTable

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
noX challenge 17 76
parentbit challenge 3 52
strCount chalenge 3 50
Printing to a specific printer tray (HP 806dn printer) 3 64
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now