when you add a JPanel with plenty of JLabel's and JTextField's in a single row to a JFrame, the JPanel will automatically resize its width to fit in the JFrame and make the JLabels and JTextField's shorter.
When you add a JPanel like this to a JScrollPane, it does not resize itself at all and requires you to scroll horizontally.
I have tried the JPanel.setSize() method to manually set the width but to no effect.
I have tried the JScrollPane.setHorizontalScrollBarPolicy(); method
and set it to:
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER,
thinking that the JPanel will automatically resize its width but also to no effect.
I would only like the JPanel to exceed the JScrollPane vertically and sqeeze its width to fit horizontally so i dont need a horizontal scrollbar, only a vertical.