I'm not sure what the best api for simple 2d graphics with Java is. I know java.awt.Graphics2D
was the standard but has it been replaced? Swing is the new API for Java GUI apps but it seems a bit heavy for what I want. What I really want is something like the C SDL library.
5 Answers
Java 2D (Graphics2D
and friends) is indeed the best choice that I know of. Swing is actually implemented on top of Java 2D, so yes, if you want non-GUI-type graphics, Java 2D is the way to go.

- 52,720
- 19
- 113
- 137

- 219,335
- 46
- 382
- 435
-
2Original link was dead, I updated it to point to the new Java 2D tutorials at Oracle's site. – Andrew White Jan 23 '14 at 20:59
If you want to have the least work possible if you're building a game (or even if not) use http://slick.cokeandcode.com/
UPDATE: The link has since changed to http://slick.ninjacave.com/
Processing.org has some good easy-to-use 2D stuff (and 3D). It has a PApplet class that implements Applet from AWT together with a bunch of useful operations and works well together with Java2D.
If you just want to mess around with 2d graphics it has a "sketchpad IDE" where you don't need to put it in your java IDE if you just want to experiment with it.

- 119,724
- 44
- 140
- 158
Piccolo can be a good choice for drawing graphics. It is a 2D graphics toolkit that supports zoomable user interface. Available for both Java and .Net.

- 26,356
- 27
- 122
- 180

- 1,201
- 3
- 19
- 33