Is there any method that I can add scroll bar to a canvas page? or actually, no need the exact scroll bar, but just like the FORM, can turn a page up and down is ok.
thx!
There is one simple way to do this. There is no inbuild method to do this. In your canvas if you need to scroll a 176x416 page and lets say your screen is 176x208, Then use a image of 176x416 and draw all the things u need in the image using image.getGraphics and use the graphics object to draw things. Now after drawing everything on to the image now draw the image tot he screen and scroll it (draw different portions of the image using setclip ) when the user presses down button.
Hope this would be simplest way which we usualy use for applications. But when you want a big page like 10 times the size of the screen then this will not work. Or will use a lot of memory.
Actually I am using DrawString, (this part of the program is also included in the GamePage.java I sent you before) but as there are too many sentences to display, it cannot be shown in 1 full screen. So, can I use drawImage in this case? I draw my the strings on the image???
no... if you are going to draw string on the screen, its much more simple. First split the string into small strings, then draw the array from 0 to 10 at first, then when the user press down key, show 1 to 11 and then again 2 to 12 and goes on. This is very much efficient when us draw scrolling text on screen.