wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes SWT: refresh the canvas Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "SWT: refresh the canvas" Watch "SWT: refresh the canvas" New topic
Author

SWT: refresh the canvas

BBird
Greenhorn

Joined: Nov 01, 2004
Posts: 6
Hi,

How to refresh the canvas?
Is there any method to refresh the canvas?
-----------------------------------------

My case:
- The first group of images is loadded onto the canvas.
- When clicking the button to load the next group of those,...
- The second group of images is loadded onto the same canvas.

Condition:
- Two groups of images are displayed onto little canvas.
- Little canvas will later be displayed on (big) canvas.

Problems:
- The first group of images is supposed to disappear, but it is actually not!
- The second group normally appears, but it displays behind the previous pix.


My questions:
How to refresh the canvas?
Is there any method to refresh the canvas?
or
Is there any method to dispose little canvas?


This code is right, but it does not work on my program. I do not know why???...
if (canvasArray != null){
// clear existing array of canvas
for (int i = 0; i < canvasArray.length; i++)
{
canvasArray[i].dispose();
}
}

Do you have any suggestion?
Thanx!
 
jQuery in Action, 2nd edition
 
subject: SWT: refresh the canvas