void addBooleanComponent(String name, boolean currentValue) { configGridLayout.setRows(configGridLayout.getRows() + 1); addConfigLabel(name); JCheckBox checkBox = new JCheckBox(); checkBox.setSelected(currentValue); componentByName.put(name, checkBox); configPanel.add(checkBox); }
void addTextBox(String name, String currentValue) { configGridLayout.setRows(configGridLayout.getRows() + 1); addConfigLabel(name); JTextField textField = new JTextField(); textField.setText(currentValue); componentByName.put(name, textField); configPanel.add(textField); }