JComponent () { myHostLabel = new JBLabel(GithubBundle.message("task.repo.host.field"), SwingConstants.RIGHT); JPanel myHostPanel = new JPanel(new BorderLayout(5, 0)); myHostPanel.add(myURLText, BorderLayout.CENTER); myHostPanel.add(myShareUrlCheckBox, BorderLayout.EAST); myRepositoryLabel = new JBLabel(GithubBundle.message("task.repo.repository.field"), SwingConstants.RIGHT); myRepoAuthor = new MyTextField(GithubBundle.message("task.repo.owner.field.empty.hint")); myRepoName = new MyTextField(GithubBundle.message("task.repo.name.field.empty.hint")); myRepoAuthor.setPreferredSize("SomelongNickname"); myRepoName.setPreferredSize("SomelongReponame-with-suffixes"); JPanel myRepoPanel = new JPanel(new GridBagLayout()); GridBag bag = new GridBag().setDefaultWeightX(1).setDefaultFill(GridBagConstraints.HORIZONTAL); myRepoPanel.add(myRepoAuthor, bag.nextLine().next()); myRepoPanel.add(new JLabel("/"), bag.next().fillCellNone().insets(0, 5, 0, 5).weightx(0)); myRepoPanel.add(myRepoName, bag.next()); myTokenLabel = new JBLabel(GithubBundle.message("task.repo.token.field"), SwingConstants.RIGHT); myToken = new MyTextField(GithubBundle.message("task.repo.token.field.empty.hint")); myTokenButton = new JButton(GithubBundle.message("task.repo.token.create.button")); myTokenButton.addActionListener(e -> { generateToken(); doApply(); }); JPanel myTokenPanel = new JPanel(); myTokenPanel.setLayout(new BorderLayout(5, 5)); myTokenPanel.add(myToken, BorderLayout.CENTER); myTokenPanel.add(myTokenButton, BorderLayout.EAST); myShowNotAssignedIssues = new JBCheckBox(VcsBundle.message("checkbox.include.issues.not.assigned.to.me")); installListener(myRepoAuthor); installListener(myRepoName); installListener(myToken); installListener(myShowNotAssignedIssues); return FormBuilder.createFormBuilder() .setAlignLabelOnRight(true) .addLabeledComponent(myHostLabel, myHostPanel) .addLabeledComponent(myRepositoryLabel, myRepoPanel) .addLabeledComponent(myTokenLabel, myTokenPanel) .addComponentToRightColumn(myShowNotAssignedIssues) .getPanel(); }