under the following condition
* layout=GridBagLayout
* cell with JCombobox
* vertical grow
* anchor = GridBagConstraints.BASELINE <- this causes the problem
i get the error
- Code: Select all
java.lang.IllegalArgumentException: Width and height must be >= 0
- Code: Select all
GridBagLayout gbl_contentPane = new GridBagLayout();
gbl_contentPane.columnWidths = new int[]{0, 0};
gbl_contentPane.rowHeights = new int[]{0, 0};
gbl_contentPane.columnWeights = new double[]{0.0, Double.MIN_VALUE};
gbl_contentPane.rowWeights = new double[]{1.0, Double.MIN_VALUE};
contentPane.setLayout(gbl_contentPane);
GridBagConstraints gbc_cmb = new GridBagConstraints();
gbc_cmb.anchor = GridBagConstraints.BASELINE;
gbc_cmb.fill = GridBagConstraints.HORIZONTAL;
gbc_cmb.gridx = 0;
gbc_cmb.gridy = 0;
contentPane.add(getCmb_1(), gbc_cmb);
cheers, michael