🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java.help
Article #23

Re: Help: This simple applet won't run.

#23
From: C. K. So
Date: Sat, 07 Aug 1999 00:00
63 lines
2147 bytes
You should create a html file, eg. graf.html:
<applet code = "graf" width = 300 height = 200>
</applet>
and run:
appletviewer graf.html

OR

add the comments to graf.java
/*
<applet code = "graf" width = 300 height = 200>
</applet>
*/
and run:
appletviewer graf.java

ps. "java" is used to run java program and "appletviewer" is used to run
java applet.
--
C. K. So
Homepage : http://members.xoom.com/ckso
Peter <peter52@tnetnz.com> wrote in message
news:37AB9ED7.B0213FC6@tnetnz.com...
>
> Hi, i have installed jdk1.2 that comes with the
> book " Just Java 2" on WIN95. I run java
> from MS-Dos prompt.
>
> I can run the demo code myframe.java but when i
> try to execute the simple code graf.java from p.561
> of " Just Java 2", i got the following error message
> ( compilation is OK):
>
> c:\jdk1.2\bin\java graf
>
> Exception in thread " main " java.lang.NosuchMethod Error: main
>
> #####
>
> Anyone has a clue of what's wrong or is there something
> wrong with my Window system ?
>
> The following is the code of graf.java
>
> import java.awt.*;
> import java.applet.*;
> public class graf extends Applet {
>
>     public void paint(Graphics g) {
>          g.drawRect(25,30,60,40);
>          g.drawRect(125,30,100,100);
>
>          g.setColor(Color.cyan);
>          g.drawOval(25,30,60,40);
>          g.drawOval(125,30,100,100);
>     }
>
> }
>
> Thanks for any help
>
> Sam
>
Technical Details
Message-ID: <7ogj2m$j9q$1@imsp009a.netvigator.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <37AB9ED7.B0213FC6@tnetnz.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d6db,7cafe47c609da7a7
X-Google-Attributes: gid10d6db,public
X-Google-Thread: 113ae9,7cafe47c609da7a7
X-Google-Attributes: gid113ae9,public
X-Google-Thread: f5d71,7cafe47c609da7a7
X-Google-Attributes: gidf5d71,public
From: "C. K. So" <ckso@hkid.com>
Subject: Re: Help: This simple applet won't run.
Date: 1999/08/07
Message-ID: <7ogj2m$j9q$1@imsp009a.netvigator.com>
X-Deja-AN: 509860021
References: <37AB9ED7.B0213FC6@tnetnz.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
Organization: Netvigator
X-MSMail-Priority: Normal
Newsgroups: comp.lang.java.help,comp.lang.java,aus.computers.java