View Single Post
  #1 (permalink)  
Old 01-22-2008, 03:12 AM
nvidia nvidia is offline
Member
 
Join Date: Aug 2007
Posts: 12
nvidia is on a distinguished road
IMPORTANT: Applet Problem Please Help!
Hi am really new to applets. I am reading a book on creating applets and i am trying to create the HelloWorld applet. I am also using Netbeans for this. The code i have used is as follows.

Code:
import java.applet.Applet; import java.awt.Graphics; public class HelloWorld extends Applet { /** Creates a new instance of HelloWorld */ public void init() { } public void paint(Graphics g) { g.drawString("Hello Luong", 50, 25); } }
After reading this book it now tells me to compile it using the java compiler but everytime i try to compile this i ALWAYS get the message:

<no main class found>

can somebody tell me what i need to do cos i have seen this example in many tutorials and there is no main class. I have attached the project folder for viewing.

In the book it also reads that i need to create an html file with the code:

Code:
<html> <head> <title> Simple Applet </title> </head> <body> Here is the output of my applet: <APPLET CODE = "HelloWorld.class" width = 150 height=25 </APPLET> </body> <html>
But before adding the html code, i need to sort out the main class issue. Can somebody give me some advice.
The location of my applet is
C:\MyNBProjects\Concurrent Programming\HelloWorld.java
Thanks
Attached Files
File Type: zip HelloWorld.zip (8.9 KB, 0 views)
Reply With Quote
Sponsored Links