Skip to content
Smith College / CSC212 / GFX library to simplify Graphics2D access.
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/main/java/me/jjfoley/gfx
.gitignore
.travis.yml
ACKNOWLEDGEMENTS
README.md
pom.xml

README.md

GFX Build Status Jitpack.io Badge

Smith College / CSC212 / GFX library to simplify Graphics2D access.

JavaDoc

Motivation

Getting a drawable canvas in Swing can require many steps, and event handlers and the EventQueue thread are full of traps for newcomers. This library simplifies all that:

import java.awt.Color;
import java.awt.Graphics2D;

import me.jjfoley.gfx.GFX;

public class MyDrawing extends GFX {
	// Draw is called 60 times per second.
	@Override
	public void draw(Graphics2D g) {
		g.setColor(Color.red);
		g.fillRect(0, 0, 200, 200);
	}

	// Running with graphics is as simple as calling ``start`` on your class.
	public static void main(String[] args) {
		MyDrawing app = new MyDrawing();
		app.start();
	}
}

Use from Maven

This repository can be used via jitpack.io. First, add the repository:

  <repositories>
    <repository>
      <id>jitpack.io</id>
      <url>https://jitpack.io</url>
    </repository>
  </repositories>

Next, add this repo:

    <dependency>
     <groupId>com.github.jjfiv</groupId>
     <artifactId>GFX</artifactId>
     <version>1.6.0</version>
   </dependency>
You can’t perform that action at this time.