• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable MultipleRoW Selection Problem

 
bolloju bnm
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11061
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
bolloju bnm
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11061
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This indicates that it is SINGLE_INTERVAL_SELECTION. Can you please put a and confirm?
 
bolloju bnm
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is giving MULTIPLE_INTERVAL_SELECTION only
 
Maneesh Godbole
Saloon Keeper
Posts: 11061
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic