• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable MultipleRoW Selection Problem

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is giving MULTIPLE_INTERVAL_SELECTION only
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic