basic use of Java graphic library