P
Prem G
Hi,
I have written a public class, lets call it class1. Within this class,
I have a method (method1) which accesses a file, retrieves a bit of
information from the file, and then returns a vector as output.
If I try to call method1 from any normal class, it works fine and I
get the resultant vector. However, when I try to do the same thing
from within an applet class...
e.g. public class class2 extends Applet {
public void init() {
....
}
public void paint(Graphics g) {
....
}
}
if I try to call method1 from within the paint method above in class2,
it just does not work. Does anyone have any idea why this method would
not work within the paint method above and still work within classes
that do not extend Applet?
Also, is there any good way of debugging the java when it gives
runtime errors within applets? In this case for example, I can view
the applet but when method1 is called, the applet crashes. I know
about using Graphics.drawString("sometext") but in cases such as this,
drawString is not very useful.
I have written a public class, lets call it class1. Within this class,
I have a method (method1) which accesses a file, retrieves a bit of
information from the file, and then returns a vector as output.
If I try to call method1 from any normal class, it works fine and I
get the resultant vector. However, when I try to do the same thing
from within an applet class...
e.g. public class class2 extends Applet {
public void init() {
....
}
public void paint(Graphics g) {
....
}
}
if I try to call method1 from within the paint method above in class2,
it just does not work. Does anyone have any idea why this method would
not work within the paint method above and still work within classes
that do not extend Applet?
Also, is there any good way of debugging the java when it gives
runtime errors within applets? In this case for example, I can view
the applet but when method1 is called, the applet crashes. I know
about using Graphics.drawString("sometext") but in cases such as this,
drawString is not very useful.