• 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:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Scroll dissapears when resizing window without showing the whole content

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I have a problem with a scrollbar. I have searched for solutions but without any progress.
The problem is that I'm using a paintcomponent in a panel. The "paintcomponent" exceeds the size of the screen so I added a scroll, but the scroll disappear when i resize the window and I'm not able to see the whole content.
Could someone please help me? What am I doing wrong?







 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rafi,
Welcome to the Ranch!

The problem is with the preferredSize set for the panel. Scrollbar works based on this. So, you have to set the preferred size in such a way to show the content. For example, when I set a preferred width of 2000 or so, I am able to see the full content.
 
Get off me! Here, read this tiny ad:
The new gardening playing cards kickstarter is now live!
https://www.kickstarter.com/projects/paulwheaton/garden-cards
reply
    Bookmark Topic Watch Topic
  • New Topic