• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need to use scrollbar in java

 
Oyewale Oyelami
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • 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
  • 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: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
swing
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • 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.
 
Rob Spoor
Sheriff
Pie
Posts: 20613
63
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*kicks the thread towards our GUI forum*
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic