Java port of the SFML book code