public
Created

  • Download Gist
gistfile1.java
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
package com.quixotix.dragonssuck;
 
import java.applet.*;
import java.awt.*;
import java.net.*;
 
public class Main extends Applet {
private Image player;
private AppletContext context;
 
public void init() {
context = this.getAppletContext();
try {
URL url = new URL(this.getDocumentBase(), "player-scaled.png");
player = context.getImage(url);
} catch (MalformedURLException e) {
e.printStackTrace();
// Display in browser status bar
context.showStatus("Could not load image!");
}
}
 
public void paint(Graphics g) {
g.drawImage(player, 0, 0, 96, 96, null);
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.