----Q: How do i enable profiling like java -Dsun.java2d.trace=count when i'm running a Applet?

A: Either set it in the applet's ControlPanel, or set an env. variable _JAVA_OPTIONS="-Dsun.java2d.trace=log".

You can also redirect the output to a file.usage: -Dsun.java2d.trace=[log[,timestamp]],[count],[out:<filename>],[help],[verbose] ----

Q: How do I profile an Applet since I can't set the appropriate properties?

A: Use AppletViewer that comes with the SDK to test and profile applets.

----

Q: I'm trying to blit alot of sprites to the screen and I just can't get the performance I want out of Java2D. Are there any other options?

A: Yes. JOGL/LWJGL provide bindings to OpenGL which is more complicated but gives a finer level of control and in most cases gives better performance. You might also consider GTGE which gives you an abstraction above Java2D/OpenGL.

----

If you can think of extra common questions for this list post the question and answer below. I'll tidy it up as time goes on. In addition, if you think an answer here is wrong also let us know.

I'm not sure. altough personally I've had better performance using the opengl api's directly. Also, I feel (again, this is subjective) that I have more control over what is happening. I mean, does java2d utilize all the extensions which opengl has to offer? in an intelligent way? I have a feeling that java2d controls too many aspects... "leave it to java2d so it will work on every device" ... to be honest, I don't really care about that. I want it to work on the best way for as many people as possible. which usually means windows with a mediocre graphics card.

Ok, for a simple test case, 1000 alpha-blended sprites on screen, moving randomly, which will do better? LWJGL or Java2d with performance flags? my money is on LWJGL. (disclaimer: I use java2d for a living, lwjgl/games is a hobby.)

Since when did games have to use alpha blending or for that matter sprites? Draw 1000 pixel perfect circles on the screen in GL or Java2D. I think I'd be the other way in that contest simply due to primitives.

Tbh, I use LWJGL so I'm more than happy to accept its a better solution for high performance bitmap based gaming, but I don't think its as cut and dry as your question makes it out to be.

How about:

Q) I'm trying to blit alot of sprites to the screen and I just can't get the performance I want out of Java2D. Are there any other options?

A) Yes. JOGL/LWJGL provide bindings to OpenGL which is more complicated but gives a finer level of control and in most cases gives better performance. You might also consider GTGE which gives you an abstraction above Java2D/OpenGL.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org