The state of the flags can be stored in a Map such as
Map<String, Boolean> filterMap = new HashMap<String, Boolean>();
Your listener just needs to set the value for that filter field option to true or false based on whether the box is checked
public void actionPerformed(ActionEvent e) {
filterMap.put(e.getActionCommand(), ((JCheckBox)e.getSource()).isSelected());
}
The method that actually builds the actual search string for Excel just needs to iterate the map and add the fields that are set to true. The ones that are false or not in the map at all don't matter.
Alternately, you could just add all of the JCheckBox components themselves to a List as you create them and iterate that list to build your filter string based on isSelected().