Hello, I have been having a rather difficult time adding a a jscrollpane to my jinternalframe. I have a panel that I am adding some objects to. I add that panel to a jscrollpane, then add the jscrollpane to the container of the JInternalFrame. I get no errors, but when I run this thing, the panel spills out over the JInternalFrame, the panel is bigger than the internal frame. When I take the jscrollpane off of it and just add the panel directly to the JInternalFrame, it fits jsut fine. However, I need the scrollbar to view all of the material. Any ideas? Here is a piece of my code.
JInternalFrame internal = new JInternalFrame("New Tree",true,true,true,true);
Container c = internal.getContentPane();
//this panel is something I created earlier and have added stuff to it
//panel is of the type java.awt.panel
panel.setBackground(Color.white);
JScrollPane jsp = new JScrollPane();
jsp.setViewportView(panel);
c.add(jsp);
internal.setSize(700,400);
internal.setOpaque(true);
internal.setVisible(true);
//I add it to a desktop pane a little later on