Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Running an Applet

SweetPSweetP Member Posts: 35
I'm trying to make an Applet run on a Solaris box.
I can't get it to run.

These files are on the server and they are all in the same
directory:

Applet.class
Graphics.class
Hello.html
HelloWorld.class

The source code for my HelloWorld.class file before compilation is:
import java.applet.Applet;
import java.awt.Graphics;

public class HelloWorld extends Applet {
public void paint(Graphics g) {
g.drawString("Hello world!", 50, 25);
}
}

This program does run locally on the JVM and in the IE
browser. So it's something on the server or not on the
server.

Also, does anyone know the minimum classes that need tob
be imported for an applet to run in IE and Netscape ?

Does anyone have any ideas ?

Thanks,

Pete

Comments

  • KyonKyon Member Posts: 113
    Hi.

    You're saying that you're trying ro run this applet in a Solaris box? What do you mean - a text console (something like a telnet session)? Then it's no wonder that your applet doesn't work since those console windows are text-only and an applet is graphical.

    Other possibility is that you've put your applet with all corresponding classes on the server and try to access it from outside (the internet) with a browser. Then you'll have to check whether the directory you're using is public or if you've got some home-directory where you can put websites (e.g. /home/username/public_html on many systems).
    Ask your admin about this.
    In case of the latter one you'll have to set the rights for all the files properly in order to be able to access them from outside. Something like chmod 701 for the directory containing the files and 604 for the files themselves should do.

    Cheers,
    Kyon
    -- planning is the substitution of hazard by error --

  • Justin BibJustin Bib USAMember Posts: 0

    __ \ http://forcoder.org \ free video tutorials and ebooks about | C PHP Visual Basic MATLAB PL/SQL Ruby Visual Basic .NET Java Python R Assembly Go C++ C# Swift JavaScript Objective-C Scratch Perl Delphi D ML Clojure Lisp Transact-SQL Rust SAS Apex Crystal Kotlin LabVIEW Erlang Alice ABAP Hack Scala Scheme Dart Prolog Fortran F# COBOL FoxPro Ada Bash Awk VBScript Julia Logo Lua | _______

Sign In or Register to comment.