Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Applet works in appletviewer, not in browser

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I wonder can anyone help me. I've written an applet that compiles nicely and outputs a number of class files. I reference the main (public) one in my HTML document as follows:
code="Name.class"
I wrote it in Notepad and compiled in SDK 1.3. I only imported java.applet.Applet, java.awt.* and java.awt.event.*, so there's no fancy Swing stuff or anything.
When I view it using Appletviewer, it works fine and dandy, as intended. However, when I view it in Netscape 4.75 or IE 5.0, some things work and some things don't. Trouble is, there's no pattern - some events do work and others don't. Also, some methods from individual classes work, while others seem not to, so I'm not sure it's a problem of class recognition.
Anyone got any ideas? I'm banging my head against the wall here!
Thanks in advance, Mick.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you compiled it in SDK1.3 then there is probably some other stuff that the browsers don't support besides swing. Try to either get the 1.3 plug in or compile it in a version of java that the browsers support.
The plug-ins are available from Sun at: http://java.sun.com/products/plugin/index.html
 
Mick Flynn
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cindy,
That worked a dream! I found out that in my HTML, I should be using the <embed> tag (Netscape) or <object> for IE. When I included the URL you gave me as where the browser should be looking for the plugin, it worked!
I also found a nice little tool on the Sun website called the HTML converter, which (apparently) converts the <applet> tags into the <embed> and <object> tags. I'm sure this is a goodie that all fellow newbies will be interested in!
Once again, thanks a lot!
MF
(Marilyn changed < so people could read the message)
[This message has been edited by Marilyn deQueiroz (edited May 12, 2001).]
 
    Bookmark Topic Watch Topic
  • New Topic