checkboxes_[0] = new JCheckBox("Title"); checkboxes_[1] = new JCheckBox("Creator"); checkboxes_[2] = new JCheckBox("Date"); checkboxes_[3] = new JCheckBox("Description"); checkboxes_[4] = new JCheckBox("Publisher"); checkboxes_[5] = new JCheckBox("Contributor"); checkboxes_[6] = new JCheckBox("Type"); checkboxes_[7] = new JCheckBox("Language"); checkboxes_[8] = new JCheckBox("Collection"); checkboxes_[9] = new JCheckBox("Rights"); checkboxes_[10] = new JCheckBox("Identifier"); checkboxes_[11] = new JCheckBox("Source"); checkboxes_[12] = new JCheckBox("Relation");
for (int count = 0; count < DinomedaMapper.FIELD_COUNT; ++count) { checkboxes_[count] = new JCheckBox(DinomedaMapper.FIELD_NAMES[count]); }
  public DinomedaIOOptions()  {    checkboxes_ = new JCheckBox[DinomedaMapper.FIELD_COUNT];    checkboxes_[0] = new JCheckBox("Title");    checkboxes_[1] = new JCheckBox("Creator");    checkboxes_[2] = new JCheckBox("Date");    checkboxes_[3] = new JCheckBox("Description");    checkboxes_[4] = new JCheckBox("Publisher");    checkboxes_[5] = new JCheckBox("Contributor");    checkboxes_[6] = new JCheckBox("Type");    checkboxes_[7] = new JCheckBox("Language");    checkboxes_[8] = new JCheckBox("Collection");    checkboxes_[9] = new JCheckBox("Rights");    checkboxes_[10] = new JCheckBox("Identifier");    checkboxes_[11] = new JCheckBox("Source");    checkboxes_[12] = new JCheckBox("Relation");    button_all_ = new JButton("Select all");    button_all_.addActionListener(this);    button_none_ = new JButton("Clear all");    button_none_.addActionListener(this);            int rows = checkboxes_.length / 2;    rows += checkboxes_.length % 2; // if the number is odd we need another row    rows += 1; // for the buttons        setLayout(new GridLayout(rows, 2));    insets_ = new Insets(5, 10, 5, 10);        for (int count = 0; count < checkboxes_.length; ++count)    {      add(checkboxes_[count]);    }        // odd number of checkboxes, need a dummy element in the second column    if ((checkboxes_.length % 2) == 1)    {      add(new JPanel());    }        add(button_all_);    add(button_none_);  }