I am working on a GUI, and in it is a JScrollPane. In the ScrollPane is a JPanel that holds multiple JTextPanes. That way there will be multiple viewable TextPanes in one scrollpane. However I want the scrollpane to not show all of the Panel that it contains; I want it to be a smaller size. I have tried putting the scrollpane in another panel, which goes in my applet, but the panel resizes because it is in a layout manager. How would I be able to make the size of the viewport set to what I want it to be?