aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes how my scrollbar works? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how my scrollbar works?" Watch "how my scrollbar works?" New topic
Author

how my scrollbar works?

vishnu vardhan brundavanam
Greenhorn

Joined: Nov 13, 2010
Posts: 11
hi....
i wrote code to draw a graph(line) by tacking data from a file ....the code for that is here...




Now the problem is the scrollbar is not working to see complete graph when i'm giving many input values.......
The here is the calling class(main) of the above code.....


the i don't how to implement this listener .....
----------------------------------------------------



i'm attaching output screen also...actually there i haven taken around 90+ input values...

please help me .....
thank u....






[Thumbnail for output.jpg]



Vishnu Vardhan Brundavanam.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Scrollbars work when the size of their child components exceed the available display say.
Try overriding getPreferredSize() in your panels (the one which paints the graphs)


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
vishnu vardhan brundavanam
Greenhorn

Joined: Nov 13, 2010
Posts: 11
could you show the code how to implement that getPreferredSize() in my application...?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4642
    
    5



luck, db
There are no new questions, but there may be new answers.
vishnu vardhan brundavanam
Greenhorn

Joined: Nov 13, 2010
Posts: 11
could you please complete this program..?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4642
    
    5

Read the API for JScrollPane and follow the link to the Java tutorial on How to Use Scroll Panes, where you will find example code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how my scrollbar works?