Nate711
Nate711

Reputation: 109

How do I embed a java swing applet into a website?

I am trying to embed a swing applet into our website, but it is not working. I have been able to get applets that use awt to do graphics to work. The web page that contains the applet only shows a blank box that should contain my applet, there aren't even any error messages. My applet works fine in netbeans. The applet is supposed to show a few buttons and a text field. I really don't know whats going on.

The web page is located at http://nuevawave.org/sandbox/JavaGallery/GUIApplet.html The applet is at http://nuevawave.org/sandbox/JavaGallery/TestApplet.jar

Here is the html:

    <html>
       <head>
          <title>Test Page</title>
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
       </head>
       <body>
           <applet Archive ="TestApplet.jar, swing-layout-1.0.4.jar"
                  Code="test.GUIApplet"
                  WIDTH="250" HEIGHT="300" >
           </applet>

       </body>
   </html>

Upvotes: 4

Views: 2714

Answers (2)

Rakesh
Rakesh

Reputation: 4334

You can use the <object> tag instead. To know how to use this, check this link

Upvotes: 1

dacwe
dacwe

Reputation: 43504

as I wrote in the comments it works for me (I'm using OpenJDK 1.6.0_22, Linux (ubuntu) and Firefox).

If java works from your "command line" or terminal. I could be that the plugin for your browser isn't installed. I would recommend you reinstalling the JDK or JRE and remember to install the plugin for the browser aswell.

Upvotes: 3

Related Questions