I have a JPanel with a GridLayout consisting of 1 row and 2 Columns.
Inside the first column, I have a JPanel consisting of a Jpanel and a Jtree.
Inside the second column, I have a JScrollPane consisting of a JTable.
How can I center-align the JscrollPAne to appear vertically center-aligned? currently, It is showing at the top and not at the center.
Here is an image:
There is a Layout manager to save you 🙂 Inside the second column, use a panel with
GridBagLayout, and insert the JScrollPane into the panel, you can specify the position of components in panel using GridBagConstraints.See this for more information : How to Use GridBagLayout