I am working on a Java Frame. I have created a questionnaire in which I use a number of ckeck boxes. The check boxes are labelled 1-15. I wish to collect the information on which checkboxes are selected and transfer them to a Db in MySQL.
For radiobuton, I manage this very easily because I can create a buttongroup and then :
int marital = 0 ;
if (jRadioButton3.isSelected() == true) marital = 1;
if (jRadioButton4.isSelected() == true) marital = 2;
and then on the sql side, a column will have a value 1 or 2 depending on which radio box is chosen.
However, with multiple checkboxes there is a possibility of multiple choices. Each checkbox has its own method. My question is this:
- How should I collect the information on which check boxes are selected. Should I transfer a vector or 15 single values?
- On the SQL side, should I have 15 columns or 1 column which can take a vector?
Thank you for your precise information.