Program makes wrong calculation for fun and for study Java Swing in NetBeans.