This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes need to use scrollbar in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "need to use scrollbar in java" Watch "need to use scrollbar in java" New topic
Author

need to use scrollbar in java

Oyewale Oyelami
Greenhorn

Joined: Mar 15, 2011
Posts: 8
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

Joined: May 03, 2008
Posts: 4523
    
    5

Welcome to the Ranch!

What exactly does your question have to do with Java?


luck, db
There are no new questions, but there may be new answers.
Oyewale Oyelami
Greenhorn

Joined: Mar 15, 2011
Posts: 8
i need to use the jscrollbar and have not used it before.. it is a java app
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Which GUI toolkit/ AWT? Swing? JFace? SWT? Something else?
Oyewale Oyelami
Greenhorn

Joined: Mar 15, 2011
Posts: 8
swing
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4339
    
    7

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

Joined: Oct 27, 2005
Posts: 19649
    
  18

*kicks the thread towards our GUI forum*


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need to use scrollbar in java
 
Similar Threads
non Java Mobile Development
Porting
full size of the screen(urgent)
get the size of the full screen in current settings(urgent)
problem with frame size