void () { GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.weightx = 1; gbc.weighty = 1; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = fill.getSelectedIndex(); if (gbc.fill < 0) gbc.fill = 0; center.removeAll(); update(field -> center.add(field, gbc)); }