Did you override that method? If not you need to add this method in your class;
public void actionPerformed(ActionEvent ae)
{
}
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
Import java.applet.*;
and that should allow it. Since you don't have an import statement you're having to use the fully qualified name. The same goes for the actionListener. If you don't want to continously use the fully qualified name, then:
import java.awt.event.*;
By the way, if you want to just test the app and not worry about adding that method, just take off the implements.... statement.
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
thanks for the help :)
i decided to start from the top with a hello world. well i cant get it to open the applet, ill run it and it will just build it.. heres the code, am i doing something small wrong?
import java.awt.event.*;
import java.awt.*;
import java.applet.*;
public class applet1 extends Applet
{
public static void main(String args[])
{
System.out.println("Hello World");
}
public void init()
{
}
// TODO overwrite start(), stop() and destroy() methods
}
also im wondering if i should be using an applet.. are frames and applets the same? i just want to make an application thats readily available anywhere where you have internet access
First of all, you DON'T have a main method with an applet you use the init() method(which you have). Second, applets are funny about calls to the command line, I doubt you'll get that to work. Instead make it draw the Hello world on the applet. like this:
import java.awt.event.*;
import java.awt.*;
import java.applet.*;
public class applet1 extends Applet
{
public void init()
{
}
public void paint(Graphics g)
{
g.drawString("Hello World",0,0);
}
// TODO overwrite start(), stop() and destroy() methods
}
See if that works.
For your last question, I would go with an applet. You won't be able to just run a framed application anywhere like you can an applet. ALL newer browsers support java and will show up applets.
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
No problem. Your very welcome. If you have any other trouble just give me a holler.
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20