Resizing Contents Within Internal Frame
I have a JInternalFrame and within it I put a JTextArea which is inside of a JScrollPane. The code for that part is below:
txt =new JTextArea();
txt.setEditable(false);
txt.setPreferredSize(new Dimension(500, 40000));
scrollPane =new JScrollPane(txt);
BoxLayout paneLayout =new BoxLayout(getContentPane(), BoxLayout.Y_AXIS);
getContentPane().setLayout(paneLayout);
getContentPane().add(scrollPane);
this.addComponentListener(this);
I have code that listens for when the internal frame is resized and then I adjust the JTextArea accordingly. It initially resizes the way I want it to but then after I release the mouse button, The JtextArea resizes itself to fit the JInternalFrame it is in. How can I stop this so that it stays the size that I want it to change to?

