@Norm Radder so, what should I add to the code in order for it to run?
posted 2 years ago
Most current browsers do not support applets. The one way to execute simple applets is to use the AppletViewer that is included in the JDK's bin folder.
Create a small html page with an applet tag that references your code and pass that as a command line argument to the appletviewer command.
It is also possible to add the applet tag code in a comment to the source program and pass the source program to the appletviewer program. For example:
C:\Program Files\Java\jdk1.8.0_60\bin\appletviewer.exe D:\JavaDevelopment\Testing\ForumQuestions12\MyLogo.java
Please use copy'n'paste in future; you have “importjava.awt.event.*;” in the first line of code, which has a compiler error in, so I think you have copied it wrongly.
And as people have already told you, nobody uses applets any more. I hope you aren't being taught about applets.