Hi all, I'm new to java programming but finding it rather fun and interesting. Right now I have
for(String name : chkNms) {
JCheckBox checkBox = new JCheckBox(name);
checkBox.setMnemonic(KeyEvent.VK_C);
checkBox.setSelected(false);
// checkBox.setActionCommand(name);
add(checkBox);
checkBox.addActionListener(this);
}
to create all the check boxes I need, roughly 30 or so. The last line add's each of the check boxes to the listener method I've created. The question now is, how do I set the listener to do something based on whats checked?
What the check boxes are for is to function as a "on" or "off" switch of values to be searched for in a Excel document for data extraction. IE: there is a check box for date and job (titled properly) if both are checked on I want to pass/add the string values of "Date" and "Job" into an array. The array will then be used to check the top cell of each column to see if "Date" or "job" are present, if yes, extract that Column of data.
Thanks for you help and time.