This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes Canvas with ScrollPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Canvas with ScrollPane" Watch "Canvas with ScrollPane" New topic
Author

Canvas with ScrollPane

khushbushah shah
Greenhorn

Joined: Jun 25, 2012
Posts: 10
0 down vote favorite


I am developing java applet application, in which i have taken scrollpane and canvas with fixed height.

and i and writing some text using graphics.drawString() function.

now the problem is, when I write string using Drawstring() function,after last line I have to increase height of canvas and have to called paint() method (in code keyDown() function) .after paint method previous data which i have already draw using drawstring() function will not appeared. how to save content of canvas before paint() and and to redraw in canvas after paint()?

also i want to set scroll position to the


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Canvas with ScrollPane