JComponent () { JPanel panel = new JPanel(new GridBagLayout()); var constraints = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, JBInsets.emptyInsets(), 0, 0); if (listPanel != null) { panel.add(listPanel, constraints); constraints.insets.top = 13; } panel.add(writtenAnnotationsPanel, constraints); return panel; }