Graphical PI calculation in Java