public void putImage ( String path , int x , int y , int w , int h , Graphics2D graphics ) { ImageIcon i = new ImageIcon ( path ) ; Image image = i . getImage ( ) ; ImageObserver io = new ImageObserver ( ) { @ Override public boolean imageUpdate ( Image img , int infoflags , int x , int y , int width , int height ) { return false ; } } ; graphics . drawImage ( image , x , y , w * 3 , h * 3 , io ) ; }
The portrayal of the current device can draw a geometric figure or print a predefine image . This method is called when the device has been linked to be draw as an image .