Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting value of CheckedComboBox  RSS feed

 
Nelvin Corbita
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a CheckedComboBox class that display jcheckbox inside jcombobox. I am having problems in getting the selected items in the CheckedComboBox and put it in a variable to be used for database insertion. I have also having problem in populating it with data from database. Here is the snippet of my code:


And this is the CheckedComboBox:



Note: Feel free to copy and use the CheckedComboBox...
 
Nelvin Corbita
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already get the values of the CheckComboBox by using getSelectedItem() method of jcombobox. My problem now is how to store it in an array so that it will display list of selected items because whenever I tried it I always get the exception CheckableItem cannot be cast...
 
Rob Camick
Ranch Hand
Posts: 2787
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I always get the exception CheckableItem cannot be cast...


Well, we don't know what you are trying to cast it to.

The question is why are you trying to cast it? Just create an Array of CheckableItem.
 
Nelvin Corbita
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did by doing this:


But I get the error CheckComboBox cannot be cast to java.util....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!