Thursday, 14 May 2015

Applet Methods of Interest in Java

  Most of what's covered in this chapter is independent of the Applet class's methods. The following are the methods that are of use when building the user interface.
Image, getImage(URL a_url)
Loads the GIF or JPEG image at the specified URL.
Image, getImage(URL a_url, String relative_file_location)
Enables you to specify a base URL, as you would get from getDocumentBase(), and an address relative to that address.
showStatus(String a_message)
Displays the specified message to the user. In the applet viewer, it's placed in the bottom edge of the applet window. The specific place where the display occurs is browser dependent.

Clearly, you can build pretty much any Java program that doesn't rely on these methods, so switching between applets and applications shouldn't be too difficult as far as your GUI is concerned.  

No comments:

Post a Comment