• 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

Can an applet call another class file?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, I'm new to a lot of this, so any help is appreciated.

I've written an applet that works just grand in the appletviewer.

In my apache 6.0.35 ROOT directory I've got the HTML file, the applet class and some supporting classes.

Here is my applet declaration:

<BODY>
<APPLET CODE="SterlingCC"
ARCHIVE="oc4j.jar,servlet.jar,servlet-api.jar,SterlingCC.jar"
CODEBASE="http://localhost:8080/";
HEIGHT="700" WIDTH="900" ALIGN="bottom">
This browser does not support Applets.
</APPLET>
</BODY>

Yes, I also have a jar file with the applet and supporting classes. Right now they are all right in the root directory.

The HTML screen comes up fine and shows the applet interface but when I click my submit button nothing seems to happen. I was wondering if there is some issue with an applet using other classes.

Also, is there a way to troubleshoot this? I don't get any errors showing up in Firefox so I was wondering if some log file might be generated that I can view.

Thanks,

George
 
Marshal
Posts: 25682
69
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, of course an applet can "call" other classes. (Note: Java programmers say that a class "uses" another class by "calling" methods from that class.)

If the applet code is throwing an exception (the most likely possibility) then you'll find the stack trace in the Java console. As for your APPLET element: it mostly looks okay to me, except of course I can't tell whether your relative URLs are correct; but I seriously doubt your applet is going to need anything from servlet.jar or servlet-api.jar. If it does, you must have misunderstood something.
 
George Hutto
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:Yes, of course an applet can "call" other classes. (Note: Java programmers say that a class "uses" another class by "calling" methods from that class.)

If the applet code is throwing an exception (the most likely possibility) then you'll find the stack trace in the Java console. As for your APPLET element: it mostly looks okay to me, except of course I can't tell whether your relative URLs are correct; but I seriously doubt your applet is going to need anything from servlet.jar or servlet-api.jar. If it does, you must have misunderstood something.



Okay, still showing my newbishness. "Java Console" -- how does one access that? When I get an error in JDeveloper I can see it easily enough and I've been poking around in Firefox but seem to be missing something.

Ah Ha! I found Java Console ... now to figure out how to have it monitor my applet.
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic