0

I got an image called badguy and it will not draw in the applet. Here is my code below.

package mainpackage;

import java.applet.Applet;
import java.applet.AudioClip;
import java.awt.Graphics;
import java.awt.Image;

public class Test3 extends Applet implements Runnable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	AudioClip shot;
	Image badguy;
	
	public void init(){
		shot = getAudioClip(getCodeBase(), "shotgun.wav");
		badguy = getImage(getCodeBase(), "/Test 3/src/mainpackage/badguy.gif");
	}
	
	public void paint(Graphics g){
		g.drawOval(20, 50, 20, 20);
		g.drawImage(badguy, 50,100, this);
		
	}
	@Override
	public void run() {
		// TODO Auto-generated method stub
		
	}
	

}

Edited by SolidSora: n/a

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by mKorbel
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.