用英文介绍中国300字:编程问题

来源:百度文库 编辑:中科新闻网 时间:2024/05/09 03:38:06
import java.awt.*;
import javax.swing.*;
public class Authority
{
public static void main(String[] args){
JFrame frame=new JFrame("Authority");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel primary=new JPanel();
primary.setBackground(Color.yellow);
primary.setPreferredSize(new Dimension(250,75));
JLabel label1=new JLabel("u got that right");
JLabel label2=new JLabel("u got that right");
primary.add(label1);
primary.add(label2);
frame.getContentPane().add(primary);
frame.pack();
frame.setVisible(true);

}
}
在JBUIDER2006下编译报错

java.lang.NoClassDefFoundError: com/borland/samples/welcome/WelcomeApp
Exception in thread MAIN
could not find the main clsaa
怎么定宜啊

根据错误提示来确定是;因为没有找到main类的定义.那是程序的入口点必须定义.