Create a gist now

Instantly share code, notes, and snippets.

package com.quixotix.dragonssuck;
import java.applet.*;
import java.awt.*;
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) {
// 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