Doubt in Applet Program

Reply

Join Date: Dec 2006
Posts: 2
Reputation: anukool is an unknown quantity at this point 
Solved Threads: 0
anukool anukool is offline Offline
Newbie Poster

Doubt in Applet Program

 
0
  #1
Dec 26th, 2006
Hi everyone iam trying to learn awt and applets. The code below has compiled well but when i run it iam getting an Exception in thread main "Java.lang.NoSuchMethodError". Could any1 pls tell me where i have gone wrong.

import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class ButtonTest extends Applet
{
Button b1;
public void init()
{
Button b1= new Button("OK");
add(b1);
}
}
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 89
Reputation: TylerSBreton is an unknown quantity at this point 
Solved Threads: 3
TylerSBreton's Avatar
TylerSBreton TylerSBreton is offline Offline
Junior Poster in Training

Re: Doubt in Applet Program

 
0
  #2
Dec 26th, 2006
Are you trying to run this program as a console application? Applets are not run the same way console applications are in Java. Java.exe is used to run applications whereas AppletViewer.exe is used to run applets.

Regards,

~Tyler S. Breton
Western New England College '08
Computer Science

Programming Lang's:

C, C#, Java, Lisp, MASM, Visual Basic 6
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 262
Reputation: Dukane is an unknown quantity at this point 
Solved Threads: 22
Dukane's Avatar
Dukane Dukane is offline Offline
Posting Whiz in Training

Re: Doubt in Applet Program

 
0
  #3
Dec 26th, 2006
Your applet runs just fine in a web browser. But as Tyler said, this program will not run as a console application.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 2
Reputation: anukool is an unknown quantity at this point 
Solved Threads: 0
anukool anukool is offline Offline
Newbie Poster

Re: Doubt in Applet Program

 
0
  #4
Dec 27th, 2006
Hi Dukane ,

I ve run it using an appletviewer and webbrowser. But iam facing the same problem. I continue to get the same error which i have specified bfore. I ve even checked my browser settings(firefox) and enabled Java for it. I ve also saved both the html and java file in the same directory still the problem continues.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 89
Reputation: TylerSBreton is an unknown quantity at this point 
Solved Threads: 3
TylerSBreton's Avatar
TylerSBreton TylerSBreton is offline Offline
Junior Poster in Training

Re: Doubt in Applet Program

 
0
  #5
Dec 27th, 2006
Compiles and runs fine for me.
Western New England College '08
Computer Science

Programming Lang's:

C, C#, Java, Lisp, MASM, Visual Basic 6
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 262
Reputation: Dukane is an unknown quantity at this point 
Solved Threads: 22
Dukane's Avatar
Dukane Dukane is offline Offline
Posting Whiz in Training

Re: Doubt in Applet Program

 
0
  #6
Dec 27th, 2006
Try updating your JRE and JDK. I have the latest version and it works fine for me. I made no changes.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC