Skip to content

Instantly share code, notes, and snippets.

@RylandAlmanza
Created November 9, 2012 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RylandAlmanza/4043828 to your computer and use it in GitHub Desktop.
Save RylandAlmanza/4043828 to your computer and use it in GitHub Desktop.
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);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment