The Artima Developer Community
Sponsored Link

Java Answers Forum
How to do an applet ?

1 reply on 1 page. Most recent reply: Nov 7, 2002 2:35 PM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Stan Dominski

Posts: 5
Nickname: stanley
Registered: Nov, 2002

How to do an applet ? Posted: Nov 7, 2002 4:14 AM
Reply to this message Reply
Advertisement
Dear People,
I am trying to do my first applet....
In reading "Java: an Eventful Approach"
http://applecore.cs.williams.edu/~cs134/eof/
by Kim B. Bruce, Andrea Pohoreckyj Danyluk, Thomas P. Murtagh

I downloaded the objectdraw library that comes with the course.
and stored it at
C://WINDOWS/jbproject

my program is stored at:
C://WINDOWS/jbproject/Stan_E_lectrue9/src/stan_e_lecture9/cloud.java

I went to the
Tools | Configure Libraries |

and added the objectdraw library

when I look at the tree I see

User Home
objectdraw

The error message says :
" The class Applet not found"

when I created the classes I checked "can run standalone"
and "generate standard methods"

I see alot of things in the "cloud class that are not
part of the class. The original class seems to have totally
disappeared.

Does it create problems to check "generate statndard methods" ?

Below is the start of what I have on my jbuilder screen now
and below that is the start of the real Cloud class.

package stan_e_lecture9;

import objectdraw.*;
import java.awt.*;

public class Cloud extends Applet {
private boolean isStandalone = false;
//Get a parameter value
public String getParameter(String key, String def) {
return isStandalone ? System.getProperty(key, def) :
(getParameter(key) != null ? getParameter(key) : def);
}

//Construct the applet
public Cloud() {
}
//Initialize the applet
public void init() {
try {
jbInit();
} etc......................................

This is the way I thought the CLoud class should start:

package stan_e_lecture9;

import objectdraw.*;
import java.awt.*;

public class Cloud extends ActiveObject {


Thank you for your assistance
Stan


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: How to do an applet ? Posted: Nov 7, 2002 2:35 PM
Reply to this message Reply
A class such as Cloud is not an Applet unless the code extends Applet appears on the line that looks like:

public class Cloud extends Applet {


Your line:
public class Cloud extends ActiveObject {
defines a class named Cloud which is an ActiveObject object, not an Applet object.

Flat View: This topic has 1 reply on 1 page
Topic: Difference between an interface and a class Previous Topic   Next Topic Topic: impossible to create a Factory Method in Java?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use