A few observations, although I do not think that any of them will help much.
The main thing is that you draw the AWT stream. Override paintComponent () and call repaint () on the object instead. This may cause other problems.
You recreate colors in every frame. This may or may not be one of the things you want to cache. I donโt think that being consistent for your colors is likely to ruin GCing and make it easier when you want to reuse colors later.
You redraw all the windows in each frame. You just need to redraw the changed sections.
You do not need to draw a background. Set the background color and let the parent take care of everything.
As a design element, bodies should be responsible for drawing. Their owner must notify them that they need to be drawn, not drawn.
Organs recreate their condition every time. Consider storing them between times and mutating them as needed. You can spend a lot of time doing trigger calculations in drawCircleBody ()
Something to consider is setting up a timer instead of using sleep during a cycle. This will provide you with a more consistent frame rate, but you need to make sure that you can actually fulfill your obligations (or combine several frames into one if you miss a deadline), or you will create too many threads.
Consider using SwingWorker to do the calculations, then update the state in the done () method, ending with a repaint () call.
These are just a few things. You have to experiment to see what works and what doesn't. It has been some time since I made a Java graphic drawing.
James source share