| Author |
JTable MultipleRoW Selection Problem
|
bolloju bnm
Greenhorn
Joined: May 15, 2007
Posts: 11
|
|
Hi Friends, I want to select multiple Rows in a JTable by holding down the CTRL Key . In my application i am losing the previous selection like, If I select 2nd Row and by holding down the CTRL key if I select 6th Row, 2nd Row is getting deselected. If you have a solution please help me.
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8573
|
|
Originally posted by bolloju bnm: Hi Friends, I want to select multiple Rows in a JTable by holding down the CTRL Key . In my application i am losing the previous selection like, If I select 2nd Row and by holding down the CTRL key if I select 6th Row, 2nd Row is getting deselected. If you have a solution please help me.
Looks like your table has the ListSelectionModel.SINGLE_SELECTION as the selection model. You should be using the ListSelectionModel.MULTIPLE_INTERVAL_SELECTION (which is the default)
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
bolloju bnm
Greenhorn
Joined: May 15, 2007
Posts: 11
|
|
Thanks for your reply. But my JTable is having MULTIPLE_INTERVAL_SELECTION as SelectionMode.With SHIFT key it is working fine.Problem is with CTRL Key only
|
 |
bolloju bnm
Greenhorn
Joined: May 15, 2007
Posts: 11
|
|
Thanks for your reply. But my JTable is having MULTIPLE_INTERVAL_SELECTION as SelectionMode.With SHIFT key it is working fine.Problem is with CTRL Key only
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8573
|
|
|
This indicates that it is SINGLE_INTERVAL_SELECTION. Can you please put a and confirm?
|
 |
bolloju bnm
Greenhorn
Joined: May 15, 2007
Posts: 11
|
|
|
It is giving MULTIPLE_INTERVAL_SELECTION only
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8573
|
|
Do you have a custom table? Is there any place you have defined a selection model? Is there any place where you have tweaked the key bindings? Can you post a short, self contained, correct example which reproduces your problem so we can take a look at it? PS. I just noticed this. "bolloju bnm" a.k.a mani. Could you please adjust your screen name to comply to the Ranch Naming Policy? Thank you. [ October 06, 2008: Message edited by: Maneesh Godbole ] [ October 06, 2008: Message edited by: Maneesh Godbole ]
|
 |
 |
|
|
subject: JTable MultipleRoW Selection Problem
|
|
|