JComponent () { myField2Variable = new IdentityHashMap<>(); FormBuilder builder = FormBuilder.createFormBuilder(); for (final TemplateVariable variable : myRepository.getTemplateVariables()) { if (variable.isShownOnFirstTab()) { JTextField field = variable.isHidden() ? new JPasswordField(variable.getValue()) : new JTextField(variable.getValue()); myField2Variable.put(field, variable); installListener(field); JBLabel label = new JBLabel(prettifyVariableName(variable.getName()) + ":", SwingConstants.RIGHT); label.setAnchor(getAnchor()); builder.addLabeledComponent(label, field); } } return builder.getPanel(); }