Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how my scrollbar works?

 
vishnu vardhan brundavanam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....



output.jpg
[Thumbnail for output.jpg]
output of the above program...
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
vishnu vardhan brundavanam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could you show the code how to implement that getPreferredSize() in my application...?
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
vishnu vardhan brundavanam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could you please complete this program..?
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic