Shiv Tattva wrote:
I found this code in(Chapter 12) head first java book.
I understood the explanation given for this in the book, but explanation for getImage() in line 2 and "this" argument in the line 3 are not given in that book.
Thanks
Hello I know, I'm very late but anyone who stuck at Head first Java chapter 12 365 page.
Just skip that page and comeback when you learn about inner classes(Only few pages to turn 378).
By using
Inner Class and
Graphics2D you can
display Image in paintComponent() Method.
Here's the code