how to add jscrollpane to jframe?

JFrame uses a BorderLayout by default. It’s default position (if you don’t specify one) is CENTER. BorderLayout will only allow one component to occupy any of it’s 5 available positions. So when you do… jframe.add(scrollFrame); jframe.add(container); It adds the scrollFrame to the center position and effectively removes it when you add container (it doesn’t actually … Read more