How to Save Java Applets from Web Pages

By Craig Witt

Developers use Java to create a wide range of applications, from games to mobile operating systems and Web content. Web applets run in the Web browser using the Java Virtual Machine. If you want to save an applet, you can download the applet file through the browser. If you want to decompile or use the code, it's best to ask the developer for permission.

Step 1

Open the page containing the Java applet in your Web browser.

Step 2

Right-click in a blank space in the browser window and select "View Source" to see the HTML code that controls the content and look of the Web page.

Step 3

Press "Ctrl-F" to open a search box. Type "

Step 4

Highlight the characters between the quotation marks surrounding the ".class" reference, located after the "code" parameter -- for example, "SampleApplet.class." This represents the location and name of the Java applet file. Copy the applet name, and then close the source view window.

Step 5

Click once on the address bar in your browser. If any characters appear after the last "/" character in the current address, delete them. Insert the cursor at the end of the address and paste the location and filename of the Java applet. Press the "Enter" key and the browser prompts you to save the applet to your computer.

Tips & Warnings

  • If the code includes a "codebase" parameter with the "" tag, the applet is stored in a directory other than the one the Web page is in. Include any directory information from the "URL" tag when you paste the class filename into the Web address.
  • Applets may have more than one class file, which you won't know until you decompile the applet file.
  • You could risk legal issues if you decompile or use the Java code of another author without permission.