aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JScrollPane not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JScrollPane not working" Watch "JScrollPane not working" New topic
Author

JScrollPane not working

Manoj Paul
Ranch Hand

Joined: Jan 18, 2007
Posts: 112
Hello friends..

In my application i put a JScrollPane, in the JScrollPane is a JPanel, on the JPanel are thumbnails views of many images with the help of ImageIcons for which i used array of JLabels... Every thing is fine working... I can view all the thumbnails of any directory, but my directory may contain many numbers of image files for which i need the JScrollPane to work properly... and its not working, the JScrollPane doesnt show any vertical or horizontal bar.. i dont know why... i tried many options but all in vain... please help..

"A Friend In Need Is A Friend INDEED"

Thanks
Brandon Broschinsky
Ranch Hand

Joined: Aug 21, 2004
Posts: 41
The size of your JScrollPane needs to be smaller than the size of your JPanel, try to set the preferred, maximum, sizes of you JScrollPane. You can also compute the size of you JPanel, i.e. the size your images use when displayed, and override the getPreferredSize method of the jpanel to return the actual size of the JPanel.

for more information take a look at this.

How to Use Scroll Panes
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JScrollPane not working