• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JScrollPane not working

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic