Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

an animated gif which dasnt refreshed..

807591Mar 16 2008 — edited Mar 16 2008
Hi all !

First let me apologize for my bad english.
Secondly, I tried to show on the screen transpaernt animated gif, in another words, sprite(character) which walk on the desktop, well, i succsed, but there is a problem, if the sprite move is head, the on the screen you will see the sprite before and after the movmenet, there is a trail.

i hope that you could help me.

my code is very simple at this moment:
public class WS extends JWindow 
{
	Image img=null;
	Image img2=null;
	Toolkit tk=null;
	public WS()
	{
		tk=Toolkit.getDefaultToolkit();
		this.setSize(500, 500);
		this.setLocation(500, 500);
		img2=tk.getImage("MijalNo.gif");
		
		this.prepareImage(img2, null);

		this.setVisible(true);
		
	}
	

	public void paint(Graphics g)
	{
	     g.drawImage(img2, 0, 0, this);	 
	}
}
thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 13 2008
Added on Mar 16 2008
1 comment
114 views