I created dynamic JCheckBox
, and I don't know how to get their value when I check it.
When I click the checkbox I want to get value and put them to SQL query.
like : query = select checkbox1, checkbox2 from table
This is my dynamic checkbox code:
roll[K] = new JCheckBox();
roll[K].setText(metaData.getColumnLabel(columnIndex));
roll[K].setBounds(X,Y,150,30);
Y = Y+30;
Rectangle r = jPanel3.getBounds();
int h=r.height;
if (Y>=h-50){
Y=0;
X=X+200;
}
jPanel3.add(roll[K]);