Tag Archives: Drawing
In mid-January, I read a Stack Overflow question about the game Kakurasu.
This is a short example of a Java Swing GUI with drawing and simple animation. The eyeballs in the GUI follow the mouse cursor as you move the cursor in the drawing area of the GUI.
When I have to draw text, I usually need to center the text in a bounding rectangle. I’ve copied and pasted this Java code several times, and I finally decided to post it here so I can copy the code from here when I need it.