//: 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)
但是如何编译这两个文件

解决方案 »

  1.   

    一个个的编译啊
    java filename.java
      

  2.   

    要先看看有没有Console.class文件.否这你要先编译Console.java,在编译Applet1d.java,
      

  3.   

    import com.bruceeckel.swing.*;
    总是找不到
      

  4.   

    把他包含入你的classpath,或是把com这个文件夹放在你的c13:Applet1d.java所在的目录里
      

  5.   

    Applet1d.java:9: package com.bruceeckel.swing does not exist
    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还是有这样的提示信息。
      

  6.   

    Console.class文件在哪,是在com.bruceeckel.swing包下吗?
      

  7.   

    首先你要找到这个Console类,看看下载的com.bruceeckel.swing包中有没有
    这个类,如果没有的话,你的程序永远也通不过编译。
      

  8.   

    thinking in java(中文版)p37 第二行“用web浏览器查看联机用户文档,就可知道getProperties()是System类的一个static方法”这句话什么意思,WEB浏览器就是IE浏览器吗?不好意思问的问题很菜,联机用户文档在哪儿,JAVA安装程序本身带有吗?如果没有到哪儿下?
    拜托哪儿高人了。