M
Michael
I've writen a rather extensive JApplet (a multiplayer chinese chess
version). Works fine, but now I've run into a problem. Here's a small
sample:
public class test extends JApplet {
public void init() {
whatsoever.dummy(123);
}
public class whatsoever {
public void dummy(int i) {}
}
}
On compiling I get the error message: "test.java:13: non-static method
dummy(int) cannot be referenced from a static context".
This is strange, because I didn't declare ANYTHING static here, and I
don't think JApplet or init() is static per default. Now I can get
around with it by declaring the entire class whatsoever as static, but
as I already said, my JApplet is already very big, and I don't think
it's very clever to rename every method in my whatsoever class to
static, along with all variables used there :-/
Does anyone know an easy solution to this problem, or can at least
give me an explanation why not?
mfg Michael
PS: If this is in the wrong newsgroup, please excuse, I'm quite new
around here, and my english is not the best (to put it mildly)
version). Works fine, but now I've run into a problem. Here's a small
sample:
public class test extends JApplet {
public void init() {
whatsoever.dummy(123);
}
public class whatsoever {
public void dummy(int i) {}
}
}
On compiling I get the error message: "test.java:13: non-static method
dummy(int) cannot be referenced from a static context".
This is strange, because I didn't declare ANYTHING static here, and I
don't think JApplet or init() is static per default. Now I can get
around with it by declaring the entire class whatsoever as static, but
as I already said, my JApplet is already very big, and I don't think
it's very clever to rename every method in my whatsoever class to
static, along with all variables used there :-/
Does anyone know an easy solution to this problem, or can at least
give me an explanation why not?
mfg Michael
PS: If this is in the wrong newsgroup, please excuse, I'm quite new
around here, and my english is not the best (to put it mildly)