Musings about Java and Swing

Monthly Archives: April 2014

Centering a String in a Bounding Rectangle

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.

Qlocktwo with Java Swing

I came across an interesting clock, the Qlocktwo, designed by Biegert & Funk. The clock is an electronic piece of art. Different letters light up at different times to tell the time in words.

2048 Game in Java Swing

Recently, I came across a game called 2048. The game was created by Gabriele Cirulli. It’s an interesting variation on a 4 x 4 sliding puzzle.