tree=newJTree(top); int v =ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED; int h =ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED; JScrollPane jsp =newJScrollPane(tree,v,h); contentPane.add(jsp,BorderLayout.CENTER); jtf =newJTextField("", 20); contentPane.add(jtf,BorderLayout.SOUTH);