aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Scroll pane doesn't works Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Scroll pane doesn Watch "Scroll pane doesn New topic
Author

Scroll pane doesn't works

Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
I have created a form using spring layout. And its a large form. So i need scrollbars.

Here is what i coded:-



But the scroll bars does't appears. Let me know what i am missing


kunal
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
This code adds a scrollbar, but it doesn't works

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18889
    
    8

I don't see where you are putting anything into the scroll pane.
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622

Here 'jp' is a panel, in which i have added all labels and textfields
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18889
    
    8

Then the first code didn't work because the line adding the panel to the scroll pane was commented out.
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
Thanks for your reply.

Wll the second code

And



Both the above code adds the scrollbar, but it doesn't scrolls
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
Here is the complete code for you to run

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
I know nothing about SpringLayout, but it seems it doesn't calculate a preferredSize (which is needed for the scrollpane)

add the indicated line
Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
Thanks for your reply Michael Dunn. That works
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scroll pane doesn't works