GridLayoutManager bug or feature?

1. Create new form. Set GridLayoutManager as layout manager.
2. Put JTextArea on the top of the form and surround it with JScrollPane.
3. Set maximum and minimum height of JScrollPane to 50. Set vertical size policy so it can only shrink. Set vertical align to top. Set border to line (in order to see the bounds of it).
4. Put JTable, surrounded by JScrollPane, on the rest of the form. Set border to line on this JScrollPane too.
5. In preview paste a large text into JTextArea (or simply press enter 15-20 times).
6. Now try to change vertical size of the form. You'll see that there is blank space between first and 2nd JScrollPane. I suppose the size of this blank space is equal to the size of JTextArea, if it was outside of JScrollPane.

Workaround: set preffered size of JScrollPane to 50 px.

Please sign in to leave a comment.