def addApplicationCheckbox(app, app_id, ap): checkbox = JCheckBox("{} ({})".format(app.capitalize(), app_id), actionPerformed= ap) checkbox.setActionCommand(app) checkbox.setSelected(True) checkbox.setVisible(False) checkbox.setActionCommand(app_id) return checkbox
def addDeviceCheckbox(device, ap, visible=False): checkbox = JCheckBox(device, actionPerformed=ap) checkbox.setActionCommand(device) checkbox.setSelected(True) checkbox.setVisible(visible) return checkbox