I am developing a car application which has option to select car features with JCheckBox
and there are about 30 JCheckBox
.
As this is a Database Application, I need to get and set selected checkboxes in Database overtime.
On Stack Overflow I found this question which is similar to my requirements but this doesn't work in my case https://stackoverflow.com/a/19246403/4099884
I am adding my check boxes like this:
package haams;
import java.util.List;
import java.util.ArrayList;
public final class HAAMS {
JCheckBox AirConditioner = new JCheckBox();;
JCheckBox ClimateControl = new JCheckBox();;
JCheckBox AntiLockBrakes = new JCheckBox();;
List<JCheckBox> CarFeatures = new ArrayList<JCheckBox>();
CarFeatures.add(AirConditioner); //Error: Package CarFeatures does not exists
CarFeatures.add(ClimateControl); //Error: Package CarFeatures does not exists
CarFeatures.add(AntiLockBrakes); //Error: Package CarFeatures does not exists
public static void main(String[] args) {}
}
Why it is saying Package CarFeatures does not exists? What am I doing wrong?