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.
我不确定使用Java的简单2d图形的最佳api是什么。我知道java.awt.Graphics2D是标准,但它已被替换? Swing是Java GUI应用程序的新API,但它似乎对我想要的东西有点沉重。我真正想要的是像C SDL库。
5 个解决方案
#1
13
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.
Java 2D(Graphics2D和朋友)确实是我所知道的最佳选择。 Swing实际上是在Java 2D之上实现的,所以是的,如果你想要非GUI类型的图形,那么Java 2D就是你的选择。
#3
3
If you want to have the least work possible if you're building a game (or even if not) use http://slick.cokeandcode.com/
如果你想建立一个游戏(或者即使没有)你可以做最少的工作,请使用http://slick.cokeandcode.com/
UPDATE: The link has since changed to http://slick.ninjacave.com/
更新:此链接已更改为http://slick.ninjacave.com/
#4
2
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.
Processing.org有一些易于使用的2D东西(和3D)。它有一个PApplet类,它从AWT实现Applet以及一系列有用的操作,并与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.
如果你只是想弄乱2D图形它有一个“草图IDE”,如果你只是想试验它,你不需要把它放在你的Java IDE中。
#5
0
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.
Piccolo是绘制图形的不错选择。它是一个2D图形工具包,支持可缩放的用户界面。适用于Java和.Net。
#1
13
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.
Java 2D(Graphics2D和朋友)确实是我所知道的最佳选择。 Swing实际上是在Java 2D之上实现的,所以是的,如果你想要非GUI类型的图形,那么Java 2D就是你的选择。
#2
#3
3
If you want to have the least work possible if you're building a game (or even if not) use http://slick.cokeandcode.com/
如果你想建立一个游戏(或者即使没有)你可以做最少的工作,请使用http://slick.cokeandcode.com/
UPDATE: The link has since changed to http://slick.ninjacave.com/
更新:此链接已更改为http://slick.ninjacave.com/
#4
2
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.
Processing.org有一些易于使用的2D东西(和3D)。它有一个PApplet类,它从AWT实现Applet以及一系列有用的操作,并与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.
如果你只是想弄乱2D图形它有一个“草图IDE”,如果你只是想试验它,你不需要把它放在你的Java IDE中。
#5
0
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.
Piccolo是绘制图形的不错选择。它是一个2D图形工具包,支持可缩放的用户界面。适用于Java和.Net。