Lecture 7A
Java Roadmap
CustomComponent
Swing
Running Swing
SwingDesign-
Demo
JButton      -    Demo
JPanel & Layouts
                    -   
Demo
JComponent's
                    -   
Demo
More JComponent's
                    -   
Demo
Swingset    -   
Demo
Converting Code
Using Plug-in
Lectures

1A: Introduction
1B: Java Intro
2A: BuildingBlocks
2B: Objects
3A: More Objects
3B: Exceptions
       & Threads
4A: Waves
4B: Nuclear &
       Particle
5A: AWT
5B: More AWT
      & Graphics
6A:Detectors &
      Simulation
6B: LHC/Atlas &
     RandomSims    
7A: Swing
7B: Java2D
8A: Java Apps
8B: Dialogs &
    MoreClasses
9A: Java I/O
9B: Utilities,
        Unicode
10A: More
    Threading
10B: File
    Handling
11A: Array,Print,
    Images
11B: SimplePhysics
    Simulation
12A: Tips &
    Techniques
12B: More Tips &
    Techniques
13A: Satellite
    
Simulations
13B: Intro to Java
    Networking
14A: Java Servers
14B: HTTP Server
15A: ServerClient
15B: ServerClient
   Expt.Simulation
16A: Course
          Review
16B: ExerciseTest
        Discussion

    Contacts
    Description
    Exercises
    Index
    Outline
    Q&A
    Resources
    StudentInfoForm
    Student Pages
    What's New

 

Home : Lectures : Lecture 7A : Using Java Plug-in
Using the Java Plug-in for Browsers

Since the current standard browsers do not have interpreters for Java 1.2, JavaSoft has developed a Java 1.2 VM plug-in.

A plug-in is a third-party program that is downloaded to the browser and runs within the browser environment.

Common plug-in's include Apple's Quicktime video viewer and Macromedia's Shockwave animater.

After a plug-in is downloaded and installed the first time, the plug-in will thereafter be run from the local disk and so will not causing any delays.

To tell the browser to use the plug-in for your applet requires some messy HTML code, unfortunately .

For example, the html code for the JButton example applet discussed earlier looks like:

The html code to run this with the plug-in with either MS Internet Explorer or Netscape becomes:

This code is a bit obscure and you don't have to understand it (Java Plug-in HTML Specification for details) since there is a tool to create this code for you.

Sun provides the Plug-in Converter -

JavaTM Plug-in 1.2 Software HTML Converter Features
(http://java.sun.com/products/plugin/1.2/features.html)

- that reads in an html file with a conventional applet tag and output an html file with the tag converted as above.

Download the converter from the above site and install it on your machine. (It is a Java program so it will run on any platform for which there is a JDK available.)

Running it will bring up a window like this:

You can convert many files at once or just one at a time.

Backup copies of the original html file are saved in the folder chosen (default is a Converter_BAK directory that is in parallel with the directory in which the converter is unpacked.)

If there are mulitiple applets in the html file, it will convert them all.

The Converter currently can set up the plug-in code for Internet Explorer or Navigator on Windows 95, Windows NT, or Solaris 2.5 & 2.6.

Templates can be defined to create tags to load the plug-in for other platforms.

If there is a JDK 1.2 available for a platform, then a plug-in can be configured since it is basically the same VM for both.

 

Home Lectures Resources Index Contacts Students


Physics Simulations with JavaTM
KTH, Kurskod: 5A1418
Curator: Clark S. Lindsey