• 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

MultipleSelect JComboBox

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am looKing to create a combobox that allows me to select more than one value at a time, but also allows me to set some items as unselectable. does anyone have any clue how i can do this using my own renderer. i have attempted to do this and failed miserable. i have yet to get anywhere which looks like progress. any help would be greatly appreciated.

i could use a JList if it is not possilbe with a jcombobox, but i need it to look like a jcomobox with the drop down arrow and such at the side. thanks in advance
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Archana Menon
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Craig Wood:







Hai Craig,
A bunch of Thanks for the code.Proved really useful.
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Archana Menon said:
i require a way through which i can select nearly 20 items in a single stretch using ctrl+A key.
Making multiple selections is easy enough with the approach used below.
For specific use of the Ctrl-A keystroke you may be better off with a plain JList, ie, not using the renderer and list selection listener shown below. You can comment them out to see which option you like.
JList comes with a lot of keyboard support which you can find summarized here: Java Look and Feel Guidelines. In the left frame scroll down to the section Appendex A: Keyboard Navigation and click on the Lists link below it.
You have all of this with the basic JList and without the renderer and SelectionManager classes. Using the renderer and SelectionManager interfere with the default keyboard support.
 
Archana Menon
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Craig Wood:
Archana Menon said:
i require a way through which i can select nearly 20 items in a single stretch using ctrl+A key.
Making multiple selections is easy enough with the approach used below.
For specific use of the Ctrl-A keystroke you may be better off with a plain JList, ie, not using the renderer and list selection listener shown below. You can comment them out to see which option you like.
JList comes with a lot of keyboard support which you can find summarized here: Java Look and Feel Guidelines. In the left frame scroll down to the section Appendex A: Keyboard Navigation and click on the Lists link below it.
You have all of this with the basic JList and without the renderer and SelectionManager classes. Using the renderer and SelectionManager interfere with the default keyboard support.



Hai Craig,
Thanks a lot.The code meets my requirement.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic