JComponent (JComponent component) { JPanel pane = new JPanel(new MigLayout("fillx, debug, novisualpadding, ins 0, gap 5", "[min!][]")); pane.add(new JLabel("A color key and IntelliJ: "), "baseline"); pane.add(component, "baseline, growx"); return pane; }