• Post Reply Bookmark Topic Watch Topic
  • New Topic

hiding elements in jcombobox

 
Srikanth Ramu
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've a JCombobox with 7 elements, out wich 2 elements should be always displayed. Out remaining 5 elements only one element should be displayed (Based on various conditions). Thus at any given point of time only 3 elements should be visible/enabled to users. I know that i've to implement a ListCellRenderer, but my efforts (by rendering at JLablel) were not fruitful. Any pointers will help.
 
Brian Cole
Author
Ranch Hand
Posts: 920
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From what you say, I don't see how a ListCellRenderer helps you. Perhaps a custom ComboBoxModel would help?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!