1 posts in topic
Flat View  Flat View

Posted By:   Maheshwar_Reddy
Posted On:   Thursday, July 26, 2001 04:51 AM

please let me know how to add the scroll pane to the panel which has the background as an image to it, the size of the image is bigger than the panel but the panel is not showing up with scrollbars... How should I do it inorder to make the scrollbars appear


Re: ScrollPanes.....

Posted By:   Christopher_Brind  
Posted On:   Thursday, July 26, 2001 07:22 PM

Assuming you already have your image...

ImageIcon icon = new ImageIcon(image);
JLabel label = new JLabel(icon);
container.add(new JScrollPane(label));

If your container is smaller than the image then the scroll bars should appear.
About | Sitemap | Contact