I have a JTable
inside of a JScrollPane
. I want to get the columns to stay fixed when I resize it. The rows stay the same size, and there is a scrollbar to move up and down. I can't get the scrollbar to work the same way on the vertical though.
Here is a picture of my project, where the y axis of Duke is perfectly normal, and has a scrollbar to scroll to the bottom of the image, the horizontal part is clearly messed up, and should not have expanded that far.
Also, if the frame was made smaller horizontally, there should be a scrollbar just like the vertical.
So my question basically ends up like this; How do you fix the size of a JTable
to not resize within the JScrollPane
, and then if it's too large for it, display scroll bars.
Btw, Each cell has an image, making up the big image.