JComponent () { JComponent mainPanel = myEditor.createComponent(); mainPanel.setPreferredSize(new Dimension(600, 400)); mainPanel.setBorder(IdeBorderFactory.createBorder(SideBorder.ALL)); return mainPanel; }