Solved

Disable multiselect in JTable

Posted on 2000-04-29
2
3,220 Views
Last Modified: 2012-06-21
How to disable the selection of multiple rows in a JTable?
0
Comment
Question by:Mindo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
going to wrong jsp page 2 71
Java: anonymous class 4 55
Selenium docs api java index 3 98
using executorService 3 25
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 …
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 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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

710 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