Making JScrollPane not stretch
I have a JScrollPane inside which is a JTextArea. This area is for messages to pop up on and such. This works fine, but for some reason it seems to stretch across the entirety of the JPanel is has been added to, even when I a) set the width of the scrollpane to less using SetPreferredSize and/or use the same method to set the width of the JPanel it is sitting in to less (I do use pack() so that these methods are actually used). All I wish to do is set the width of the text area so that it sits nicely in the middle of the gui rather than stretching to the edges, which looks bad and isn't needed.