JComponent () { myAttrPanel.ensureFitToScreen(200, 200); JPanel centerPanel = new JPanel(new GridBagLayout()); centerPanel.add(myAttrComponent, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, JBInsets.emptyInsets(), 0, 0)); return centerPanel; }