[5643] in java-interest
[Mac] Constructor Problem
daemon@ATHENA.MIT.EDU (Steve Nelson)
Wed Feb 21 05:02:32 1996
Date: Wed, 21 Feb 1996 00:40:05 -0800
To: java-interest@java.sun.com
From: senelson@mediacity.com (Steve Nelson)
Hi. I'm trying to get a short applet to compile on a Mac running the JDK
1.0 Beta (what else?) and am getting frustrating and bewildering error
messages.
Here's the error:
StevesApplet.java: no constructor matching Jubal(int, int, int, int) found
in class Jubal.
>> theJubal = new Jubal(50, 50, 50, 50);
>>
Here's the code:
import java.applet.Applet;
import java.awt.*;
class Jubal {
int x;
int y;
int height;
int width;
public void Jubal(int newX, int newY, int newHeight, int newWidth) {
x = newX;
y = newY;
height = newHeight;
width = newWidth;
}
public void Jubal() {
x = 50;
y = 50;
height = 50;
width = 50;
}
void draw(Graphics theWindow) {
theWindow.drawOval(x, y, height, width);
}
}
public class StevesApplet extends Applet {
Jubal theJubal;
public void init() {
resize(150, 150);
theJubal = new Jubal(50, 50, 50, 50);
}
public void paint(Graphics theWindow) {
theJubal.draw(theWindow);
}
}
I can't say that I understand the error message, considering I've got a
perfectly good constructor for Jubal(int, int, int, int). Sorry if this is
a newbie mistake... Thanks!
=SN
Steve Nelson
MediaCity HTML Design Staff Phone: (415) 854-9634
senelson@mediacity.com Fax: (415) 854-4655
---------------------------------------------------------------------
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com