I have a java applet and I want to add a pre-designed Jpanel on my jpanel as a form. My Jpanel form is in another java file called MyForm.java. my JavaApplet class code is:
public class JavaApplet extends JApplet{
@Override
public void init(){
Container container = this.getContentPane();
container.add(new MyForm());
}
}
My html code to run this page is as simple:
<HTML>
<HEAD>
<TITLE>The Palindrome Page</TITLE>
</HEAD>
<BODY>
<P>My favorite meat-related palindrome is:
<BR>
<APPLET CODE="JavaApplet.class" WIDTH=600 HEIGHT=100>
A secret if your browser does not support Java!
</APPLET>
</BODY>
</HTML>
now can I put both .class files (MyForm.clsss & JavaApplet.cleass) in htmls file? Is it necessary to put all of my code in single file?
thank you