JComponent () { JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints constr; // list label constr = new GridBagConstraints(); constr.gridy = 0; constr.anchor = GridBagConstraints.WEST; constr.fill = GridBagConstraints.HORIZONTAL; panel.add(SeparatorFactory.createSeparator(IdeCoreBundle.message("label.macros"), null), constr); // macros list constr = new GridBagConstraints(); constr.gridy = 1; constr.weightx = 1; constr.weighty = 1; constr.fill = GridBagConstraints.BOTH; constr.anchor = GridBagConstraints.WEST; panel.add(ScrollPaneFactory.createScrollPane(myMacrosList), constr); myMacrosList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); myMacrosList.setPreferredSize(null); // preview label constr = new GridBagConstraints(); constr.gridx = 0; constr.gridy = 2; constr.anchor = GridBagConstraints.WEST; constr.fill = GridBagConstraints.HORIZONTAL; panel.add(SeparatorFactory.createSeparator(IdeCoreBundle.message("label.macro.preview"), null), constr); // preview constr = new GridBagConstraints(); constr.gridx = 0; constr.gridy = 3; constr.weightx = 1; constr.weighty = 1; constr.fill = GridBagConstraints.BOTH; constr.anchor = GridBagConstraints.WEST; panel.add(ScrollPaneFactory.createScrollPane(myPreviewTextarea), constr); myPreviewTextarea.setEditable(false); myPreviewTextarea.setLineWrap(true); myPreviewTextarea.setPreferredSize(null); panel.setPreferredSize(JBUI.size(400, 500)); return panel; }