void (final JPanel panel, final GridBagConverter converter) { GridBagConverter.Result[] results = converter.convert(); for (GridBagConverter.Result result : results) { JComponent component = result.isFillerPanel ? new JPanel() : result.component; if (result.minimumSize != null) { component.setMinimumSize(result.minimumSize); } if (result.preferredSize != null) { component.setPreferredSize(result.preferredSize); } panel.add(component, result.constraints); } }