//: c13:Applet1d.java
// From 'Thinking in Java, 2nd ed.' by Bruce Eckel
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
// Console runs applets from the command line.
// <applet code=Applet1d width=100 height=50>
// </applet>
import javax.swing.*;
import java.awt.*;
import com.bruceeckel.swing.*;public class Applet1d extends JApplet {
public void init() {
getContentPane().add(new JLabel("Applet!"));
}
public static void main(String[] args) {
Console.run(new Applet1d(), 100, 50);
}
} ///:~中的import com.bruceeckel.swing.*;包我已经找到代码(Console.java)
但是如何编译这两个文件
// From 'Thinking in Java, 2nd ed.' by Bruce Eckel
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
// Console runs applets from the command line.
// <applet code=Applet1d width=100 height=50>
// </applet>
import javax.swing.*;
import java.awt.*;
import com.bruceeckel.swing.*;public class Applet1d extends JApplet {
public void init() {
getContentPane().add(new JLabel("Applet!"));
}
public static void main(String[] args) {
Console.run(new Applet1d(), 100, 50);
}
} ///:~中的import com.bruceeckel.swing.*;包我已经找到代码(Console.java)
但是如何编译这两个文件
java filename.java
总是找不到
import com.bruceeckel.swing.*;
^
Applet1d.java:17: cannot access Console
bad class file: .\Console.class
class file contains wrong class: com.bruceeckel.swing.Console
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
Console.run(new Applet1d(), 100, 50);
^
2 errors还是有这样的提示信息。
这个类,如果没有的话,你的程序永远也通不过编译。
拜托哪儿高人了。