如何用Java创建图形?

时间:2023-02-04 16:32:38

I was wondering about how is possible to make graphics in a programming language just like Java, I mean in the web there are HTML + CSS etc but what here?

我想知道如何用Java编写一种编程语言的图形,我的意思是在网上有HTML + CSS等但是这里有什么?

I already found out I might start to code with Java Swing (?) but if that's so: where's the best place to start learning it and really briefly: what can I do with that?

我已经发现我可能会开始使用Java Swing(?)编写代码,但如果是这样的话:哪里是开始学习它的最佳位置,而且非常简单:我能用它做什么?

Please, note I don't want to start a broad talk with this question, so don't worry and be brief if you don't want to spen too many words with it ;)

请注意,我不想开始广泛谈论这个问题,所以如果你不想用太多的话,不要担心并简短说明;)

1 个解决方案

#1


For graphics you can use a Canvas/JPanel with Swing, JavaFX, or libGDX if you need a bit more power behind your graphics as it used OpenGL.

对于图形,如果在使用OpenGL时需要更多的图形功能,可以使用带有Swing,JavaFX或libGDX的Canvas / JPanel。

As some of the other commenters have already shown, there are many tutorials on how to use all three options, so you're pretty-well set to learn whichever you choose. I'm not entirely sure how well JavaFX deals with graphics, but Swing works perfectly fine for most purposes.

正如其他一些评论者已经展示的那样,有很多关于如何使用这三个选项的教程,所以你可以很好地学习你选择的任何一个。我不完全确定JavaFX如何处理图形,但Swing在大多数情况下都能正常工作。

#1


For graphics you can use a Canvas/JPanel with Swing, JavaFX, or libGDX if you need a bit more power behind your graphics as it used OpenGL.

对于图形,如果在使用OpenGL时需要更多的图形功能,可以使用带有Swing,JavaFX或libGDX的Canvas / JPanel。

As some of the other commenters have already shown, there are many tutorials on how to use all three options, so you're pretty-well set to learn whichever you choose. I'm not entirely sure how well JavaFX deals with graphics, but Swing works perfectly fine for most purposes.

正如其他一些评论者已经展示的那样,有很多关于如何使用这三个选项的教程,所以你可以很好地学习你选择的任何一个。我不完全确定JavaFX如何处理图形,但Swing在大多数情况下都能正常工作。