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

need to use scrollbar in java

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i need to use scroll bar to a windows app i developed.. simply because
after deployment.. if install on a notebook of smaller screen size. the
size of the form tends to be more longer than the screen.

Or better still if any one have the concept of getting the windows size
and resizing the form according to the windows size..
Thanks
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

What exactly does your question have to do with Java?
 
Oyewale Oyelami
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i need to use the jscrollbar and have not used it before.. it is a java app
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which GUI toolkit/ AWT? Swing? JFace? SWT? Something else?
 
Oyewale Oyelami
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
swing
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Swing, I think the easiest way is to use JScrollPane (see the Scroll Pane Java Tutorial). Add all your components to a JPanel, put the panel in the JScrollPane, and then add that to your form. Everything in the JScrollPane becomes scrollable if necessary. The link contains examples.

As you suggest, though, a better solution might be to get your form to resize nicely in the first place. How easy that is depends on your layout, but the tools of choice here are Layout Managers. There are a range that can provide different types of re-sizing behaviour. Again, the Java Tutorials are a good place to start.
 
Sheriff
Posts: 22849
132
Eclipse IDE Spring Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
*kicks the thread towards our GUI forum*
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic