I include a JPanel with a null layout in a JScrollPane, and it doesn't display the scrollbars. Why?
Created May 4, 2012
First, always use layout managers when constructing a GUI! See Effective Layout Management (http://developer.java.sun.com/developer/onlineTraining/GUI/AWTLayoutMgr) for details on why, what layout managers are and how to use them.
Second, a JScrollPane asks the contained component for its preferred size. A JPanel with no layout manager returns (0,0), which tells the JScrollPane that it doesn't need to provide scrollbars.