dcsimg

How can I add a scrollbar to my JFrame so that it can contain more than one page?

Sandip Chitale


f = new JFrame();
sp = new JScrollPane();
f.setContentPane(sp);

// now add you components to sp
// For example -
sp.setViewportView(new JTree());