JComponent () { final JLabel label = new JLabel(JavaUiBundle.message("prompt.please.select.project.jdk")); label.setUI(new MultiLineLabelUI()); final JPanel panel = new JPanel(new GridBagLayout()){ @Override public Dimension getPreferredSize() { return new Dimension(-1, 200); } }; panel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBInsets.emptyInsets(), 0, 0)); myJDKsComponent.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); panel.add(myJDKsComponent, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, JBInsets.emptyInsets(), 0, 0)); return panel; }