|
-
Why its giving this msg " Exception in thread "main" java.lang.NoSuchMethodError: mai
// Java packages
import java.awt.Graphics; // import class Graphics
import javax.swing.JApplet; // import class JApplet
public class WelcomeApplet2 extends JApplet {
// draw text on applet’s background
public void paint( Graphics g )
{
// call superclass version of method paint
super.paint( g );
// draw two Strings at different locations
g.drawString( "Welcome to", 25, 25 );
g.drawString( "Java Programming!", 25, 40 );
} // end method paint
} // end class WelcomeApplet2
/* when i compfile javac WelcomeApplet2.java its fine it make the class file then run the class file
java WelcomeApplet2
it gives this message
Exception in thread "main" java.lang.NoSuchMethodError: main
*/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks