我按照书上写的小程序,为什么编译会出错,小菜鸟的菜鸟题。。。xiwang
//画五环。package com.lzw;
import java.awt.*;
import javax.swing.*;
public class DrawCircle extends JFrame{
private final int OVAL_WIDTH = 80;
private final int OVAL_HEIGHT = 80;
public DrawCircle () {
super ();
initialize ();
}
private void initialize () {
this.setSize(300,200);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setContentPane(new DrawPanel());
this.setTitle("绘图实例1");
}
public static void main(String[] args){
new DrawCircle().setVisible(true);
}
class DrawPanel extends JPanel{
public void paint(Graphics g){
super.paint(g);
g.drawOval(10,10,OVAL_WIDTH,OVAL_HEIGHT);
g.drawOval(80,10,OVAL_WIDTH,OVAL_HEIGHT);
g.drawOval(150,10,OVAL_WIDTH,OVAL_HEIGHT);
g.drawOval(50,70,OVAL_WIDTH,OVAL_HEIGHT);
g.drawOval(120,70,OVAL_WIDTH,OVAL_HEIGHT);
}
}
}
//编译过程 cmd.exe
// c:>javac DrawCircle.java 编译正常通过
// c:>java DrawCircle 编译出错显示 找不到或无法加载主类 DrawCircle
//首先声明: 简单的hallojava 程序可以编译通过!
。。。求解答》》》》》》