aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Single interval selection in two lists Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Single interval selection in two lists" Watch "Single interval selection in two lists" New topic
Author

Single interval selection in two lists

michael delta
Ranch Hand

Joined: Aug 11, 2009
Posts: 35

Hello, I have these Lists:



I add these lists on the same panel, moviesPane. How is it possible to be able select (or have highlighted) only one movie,dvd OR blueray?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10523
    
    9

Listen to selection events. On selection call clearSelection() on the other list.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
michael delta
Ranch Hand

Joined: Aug 11, 2009
Posts: 35

Thank you for the response.

I did this:



Doesnt seem to work though...any ideas?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10523
    
    9

Change to
michael delta
Ranch Hand

Joined: Aug 11, 2009
Posts: 35

I also had to write:

if(e.getSource()==dvdList.getSelectionModel())


Thank you so much for this!!
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10523
    
    9

michael delta wrote:I also had to write:

if(e.getSource()==dvdList.getSelectionModel())


Well done
Shame on me. I did not notice it! Duh!
 
Don't get me started about those stupid light bulbs.
 
subject: Single interval selection in two lists