posted 21 years ago
Because the content pane uses BorderLayout and you are adding it to the center, the scrollpane takes up all available space. JPanel by default uses FlowLayout, which displays components as they are added according to their preferred size. An empty scrollpane has no preferred size, so it's there, it just has a size of 0, so you can't see it.
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.