private static void toggleVisibleOnApi(JCheckBox component,int maxApiLevel,int apiLevel){
  component.setVisible(apiLevel <= maxApiLevel);
  if (!component.isVisible()) {
    component.setSelected(false);
  }
}

private static void toggleVisibleOnApi ( JCheckBox component , int maxApiLevel , int apiLevel ) { component . setVisible ( apiLevel <= maxApiLevel ) ; if ( ! component . isVisible ( ) ) { component . setSelected ( false ) ; } }
shows or hides a checkbox based on a given api level and the max api level for which it should be shown
