Best API for simple 2D graphics with Java

bjwbell picture bjwbell · Oct 16, 2008 · Viewed 38.5k times · Source

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.

Answer

Chris Jester-Young picture Chris Jester-Young · Oct 16, 2008

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.