applet is not execute in java program

J

java prob

i have window xp on my pc and i have java verson 5.0 when i compile applet
related program it dosn't show any error but when i give command for run it
display the error that Exception in thread"main" java.lang.no function declare
but the same program i type in my institute(NIIT) it will run
even it is the same prog
i do all the formalityes no typing mistake i am sandig u a prog sample

import java.awt.*;
import javax.swing.*;
public class SampleLayout extends JApplet
{
JButton b1,b2,b3,b4;
GridLayout g1;
public void main(String arg[])
{
g1=new GridLayout(2,2);
JPanel p1=new JPanel();
getContentPane().add(p1);
p1.setLayout(g1);
b1=new JButton("Button1");
b2=new JButton("Button2");
b3=new JButton("Button3");
b4=new JButton("Button4");
p1.add(b1);
p1.add(b2);
p1.add(b3);
p1.add(b4);
}
}
/*<Applet code="SampleLayout.class" height=300 width=300>
</Applet>*/
is ther any mistake pls pls pls email my mistake at

(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
please
 
J

John Vinson

On Mon, 21 Aug 2006 10:09:02 -0700, java prob <java
i have window xp on my pc and i have java verson 5.0 when i compile applet
related program it dosn't show any error but when i give command for run it
display the error that Exception in thread"main" java.lang.no function declare
but the same program i type in my institute(NIIT) it will run
even it is the same prog
i do all the formalityes no typing mistake i am sandig u a prog sample

I would suggest that you repost this question in a Java support forum.
This newsgroup is for a different program, the Microsoft Office Pro
database software Microsoft Access.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top