I have a JScrollPane
that has a JTextArea
in it. I also have a JPanel panel = new JPanel(new GridBagLayout)
and a GridBagConstraints constraints = new GridBagConstraints()
and this GridBagLayout is a 4x9. I am trying to insert the JScrollPane onto the first column, and taking up the bottom 8 tiles, however, I can only get it to fill its width and
constraints.gridx = 0;
constraints.gridy = 1;
constraints.gridwidth = 1;
constraints.gridheight = 8;
constraints.fill = GridBagConstraints.HORIZONTAL;
Setting constraints.fill = GridBagConstraints.BOTH
does not do anything. I have tried setting contraints.ipady = 100
which works in filling out multiple rows however this is a fixed integer and I can't seem to get the grid cell size anywhere. The GridBagLayout.getLayoutDimensions()
returns an empty integer double array.
How can I make the JScrollPane fill the whole 8 rows?
I've tried everything described above.
gridheight = 8
is correct, but notfill = ...HORIZONTAL
||| most probably the cells (rows) are not the size you expect