你把borland的这类所在的包的路径设置到classpath里面去.borland这个包我没用过,所以不知道具体的位置.如果用到自定义的类库也要设置到classpath里面去,就跟你运行一般的java程序一样,如果需要第三方的类库就要用classpath,或者是放入到jdk文件夹下的jre/lib/ext目录下.

解决方案 »

  1.   

    你用了borland公司自己的一些组件 ,
    这些组件不是j2sdk自带的,你在jb中运行可以,但用浏览器就不行了,
    你找到borland这些包,应该是一些.jar包,将他们的路径放到环境变量classpath里面应该就可以解决
      

  2.   

    borland公司的那些包好像在jbuilder目录下的lib文件夹里面,具体是哪个我就不太清楚了.
      

  3.   

    都试了,还是不行!
    我贴下原代码,哪位大虾帮我试下。
    package test;import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;/**
     * <p>Title: </p>
     * <p>Description: </p>
     * <p>Copyright: Copyright (c) 2003</p>
     * <p>Company: </p>
     * @author not attributable
     * @version 1.0
     */public class AppletTest extends Applet {
      private boolean isStandalone = false;
      JPanel jPanel1 = new JPanel();
      XYLayout xYLayout1 = new XYLayout();
      JTextField jTextField1 = new JTextField();
      JButton jButton1 = new JButton();
      JTextField jTextField2 = new JTextField();
      JLabel jLabel1 = new JLabel();
      //Get a parameter value
      public String getParameter(String key, String def) {
        return isStandalone ? System.getProperty(key, def) :
          (getParameter(key) != null ? getParameter(key) : def);
      }  //Construct the applet
      public AppletTest() {
      }
      //Initialize the applet
      public void init() {
        try {
          jbInit();
        }
        catch(Exception e) {
          e.printStackTrace();
        }
      }
      //Component initialization
      private void jbInit() throws Exception {
        jPanel1.setLayout(xYLayout1);
        xYLayout1.setWidth(300);
        xYLayout1.setHeight(400);
        this.setBackground(SystemColor.info);
        jButton1.setBackground(SystemColor.textHighlight);
        jButton1.setForeground(Color.orange);
        jButton1.setText("&Egrave;·&para;¨");
        jButton1.addActionListener(new AppletTest_jButton1_actionAdapter(this));
        jTextField1.setBackground(Color.pink);
        jTextField1.setText("");
        jPanel1.setBackground(SystemColor.activeCaptionBorder);
        jPanel1.setAlignmentY((float) 0.5);
        jTextField2.setBackground(Color.pink);
        jTextField2.setText("");
        jLabel1.setFont(new java.awt.Font("Monospaced", 0, 12));
        jLabel1.setForeground(Color.yellow);
        jLabel1.setText("  &Ccedil;&euml;&Ecirc;&auml;&Egrave;&euml;&Ograve;&raquo;&Ecirc;&yacute;×&Ouml;&ordm;ó&micro;&yen;&raquo;÷&Egrave;·&para;¨&pound;&ordm;");
        this.add(jPanel1, null);
        jPanel1.add(jTextField2,   new XYConstraints(55, 130, 216, 27));
        jPanel1.add(jButton1, new XYConstraints(200, 102, 67, 17));
        jPanel1.add(jTextField1, new XYConstraints(180, 56, 89, 20));
        jPanel1.add(jLabel1,  new XYConstraints(14, 54, 161, 20));
      }
      //Get Applet information
      public String getAppletInfo() {
        return "Applet Information";
      }
      //Get parameter info
      public String[][] getParameterInfo() {
        return null;
      }  void jButton1_actionPerformed(ActionEvent e) {
        char input = jTextField1.getText().charAt(0);
        switch(input){
          case 49: jTextField2.setText(new String("&Auml;ú&Ecirc;&auml;&Egrave;&euml;&micro;&Auml;&Ecirc;&Ccedil;1&iexcl;&pound;"));break;
          case 50: jTextField2.setText(new String("&Auml;ú&Ecirc;&auml;&Egrave;&euml;&micro;&Auml;&Ecirc;&Ccedil;2&iexcl;&pound;"));break;
          default:
            jTextField2.setText(new String("&Auml;ú&Ecirc;&auml;&Egrave;&euml;&micro;&Auml;&Ecirc;&Ccedil;&sup2;&raquo;&ordm;&Iuml;·¨&micro;&Auml;&Ecirc;&yacute;×&Ouml;&iexcl;&pound;"));break;
         case 51:jTextField2.setText(new String("&Auml;ú&Ecirc;&auml;&Egrave;&euml;&micro;&Auml;&Ecirc;&Ccedil;3&iexcl;&pound;"));break;
        }
      }}class AppletTest_jButton1_actionAdapter implements java.awt.event.ActionListener {
      AppletTest adaptee;  AppletTest_jButton1_actionAdapter(AppletTest adaptee) {
        this.adaptee = adaptee;
      }
      public void actionPerformed(ActionEvent e) {
        adaptee.jButton1_actionPerformed(e);
      }
    }
      

  4.   

    还有个问题,就是如果每要在Applet中引用个非标准或自定义的类库,就要在客户端进行这么负责的环境配置,那岂不是很麻烦?
      

  5.   

    对。就是这样,客户端要安装JRE。
      

  6.   

    但JRE只有JAVA的一些核心类库,如Applet里用到第三方或自定义的类库,怎么办?客户端显示会不会有问题?就想上面那个AppletTest有用到borland的jbcl包,在浏览器里就不能正常显示。
    哪位大虾能清楚的说下Applet在浏览器中的显示过程?