Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

4.4. Greenfoot images

Greenfoot provides a class called GreenfootImage that helps in using and manipulating images. We can obtain an image by constructing a new GreenfootImage object—using Java’s new keyword—with the file name of the image file as a parameter to the constructor. For example, to get access to the crab2.png image, we can write

new GreenfootImage("crab2.png")


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial