CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ | Grades

Applets

Applets
Locating Resource
Using the URL Class

The java.net.URL class can be used to identify files (image, audio, text, etc.) on the Internet. In general, a URL (Uniform Resource Locator) is a pointer to a "resource" on the World Wide Web on a local machine or a remote host. A resource can be something as simple as a file or a directory.

An URL for a file can also be accessed by class code in a way that is independent of the location of the file as long as the file is located in the class directory.

Previous | Locating Resource from Applets | Creating ImageIcon Using Absolute File Names | Creating ImageIcon Using Relative File Names | Using the URL Class | Creating a URL from a Class Reference | Displaying image