This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SWT: refresh the canvas
 
Similar Threads
Canvas
Problem in refresh the display
SWT
How does canvas, an exteded JPanel obj have methods getSize(), createImage(size.width, size.height)?
Most efficient way to use a spritesheet?