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
  • PrintPrint

4.4. Resource Management

Consistent with the design of the rest of SWT, colors, fonts, and images are also thin wrappers around their platform counterparts that must be explicitly destroyed when no longer needed.

The basic rule is: If you access a color, font, or image from somewhere else, you don’t need to worry about it. On the other hand, if you create the resource, then you must destroy it when you are done with it. For any resources that you anticipate routinely accessing within your application, consider creating a resource manager to manage them and then destroy all the resources when your application exits.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

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

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint