applet question????!!

houssam_ballout

New Member
hello all,
I would ask about the applet: When I create the .java file, Must it contain the main() function? cause I have create a one that contains that main() function it has worked but on the second page that has been loaded when I click on the html file.
 
houssam_ballout said:
with applet in the code tage , do I have to include the .class or .java file.
what do you mean? the .class and .java is the same file.. the .class file is in byte code.. so if u try to open it in notepad, all u see are a bunch of symbols.. its the file that the java virtual machine runs..
 
i mean, when u write the code insdie the html page, u have to write:
<applet code=Program.class ... >,
That is my case:
I had a file with the main()_ function insdie it, but when I try to put it with the applet tag, it tells me that the applet failed to initialized,
Then I make a file without the main function, and include it inside the applet file (in the html page), and then it works!!!!!
 
Okay, a JApplet is different than a java application. A JApplet is not directly executed by the java interpretor. That is why it does not contain a main function. Instead, it is controlled by the java plug in.
 
Back
Top