我做了一个APPLET程序,我在WEB中运行的时候,APPLET程序显示不出来.是什么原因?请各位高手帮帮小弟.谢谢!
APPLET程序:
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.TextField;
import java.io.FileNotFoundException;
import java.io.IOException;
import javax.swing.JApplet;
import jp.co.ntl.Util;
import jp.co.ntl.ext.GlobalContext;
import jp.co.ntl.preference.PreferenceInfo;
import jp.co.ntl.swing.ext.ImageInfo;
import jp.co.ntl.swing.ext.ImagePanel;
import jp.co.ntl.swing.ext.printauth.PrintAuthToolPanel;public class PrintApplet extends JApplet {
ShowPrintTool spsPanel;
ImagePanel  pnlBackground;
TextField txt;
    public void init() {
//Resource.load(Util.getCurrentLocale());
    
         
PreferenceInfo prefInfo = new PreferenceInfo();
try {
prefInfo.readFromFile();
} catch (FileNotFoundException e) {
} catch (IOException e) {
}
    
    
GlobalContext.getInstance().setPreferenceInfo(prefInfo);
GlobalContext.getInstance().setAppName(GlobalContext.APP_NAME_PRINTAUTH);
     System.out.println("3");
setSize(WIDTH, HEIGHT);
pnlBackground = new ImagePanel(ImageInfo.getImage(ImageInfo.BACKGROUND));
//pnlBackground = new ImagePanel("background.gif");
Container cont = getContentPane();
pnlBackground.setLayout(null);
pnlBackground.setBounds(0, 0, WIDTH, HEIGHT);
cont.add(pnlBackground);
     System.out.println("4"); spsPanel = new ShowPrintTool(this, PrintAuthToolPanel.USER, pnlBackground);
spsPanel.setBounds(39, 198, PrintAuthToolPanel.WIDTH, PrintAuthToolPanel.HEIGHT);
//spsPanel.addActionListener(this);
pnlBackground.add(spsPanel); setBounds(0, 0, getWidth(), getHeight()); setVisible(true);

     /*
     txt=new TextField();
     txt.setText("How are you!");
Container cont = getContentPane();
cont.add(txt);
*/
    }    public void destroy() {
       // remove(spsPanel);
    }    public String getAppletInfo() {
        return "An interactive demonstration of some graphics.";
    }
}SERVLET程序
package user;import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lib.common.AbstractServlet;
import lib.pgdb.DBData;
import lib.pgdb.PGDBConnector;
import lib.pgdb.DBConstants;
import lib.xmlrpc.TAG;
import lib.xmlrpc.TAGLIST;public class SearchUserServlet extends HttpServlet {
String dbURL;
String dbUser;
String dbPassword; public void init(ServletConfig config) throws ServletException {
super.init(config);
dbURL = new String(config.getServletContext().getInitParameter("DBURL"));
if (dbURL == null) {
throw new ServletException("DBURL is null");
}
dbUser = new String(config.getServletContext().getInitParameter(
"DBUser"));
if (dbUser == null) {
throw new ServletException("DBUser is null");
}
dbPassword = new String(config.getServletContext().getInitParameter(
"DBPassword"));
if (dbPassword == null) {
dbPassword = "";
}
} public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { PGDBConnector pgConnector = new PGDBConnector(dbURL,dbUser,dbPassword);
try {
System.out.println("DB connect");
pgConnector.connect();
} catch (SQLException e) {
System.out.println("SQLException: " + e.getMessage());
} catch (ClassNotFoundException e) {
System.out.println("ClassNotFoundException: " + e.getMessage());
}

// request.getParameter(arg0)
String username=request.getParameter("username");
String userpwd=request.getParameter("userpwd");

ResultSet rs = null;
DBData[] dbWhere={
new DBData("username",username,0,DBData.COND_AND),
new DBData("userpass",userpwd,0,DBData.COND_AND)
};
Vector vcTagList= new Vector();
TAGLIST taglist=UserUtil.initTAGLIST();
try {
rs = pgConnector.queryTable(DBConstants.TABLE_USER,dbWhere,DBConstants.KEY_USER_ID);
if (rs == null) {
throw new SQLException("Result is null");
}
while (rs.next()) {
TAGLIST tags = UserUtil.setDBtoTAGLIST(taglist, rs);
vcTagList.addElement(tags);
}
rs.close();
TAG[] tag=((TAGLIST)vcTagList.elementAt(0)).getTagArray();
for(int i=0;i<tag.length;i++)
System.out.println(tag[i].getName()+":"+tag[i].getStringValue());
showIndexPage(response);
} catch (SQLException e) {
}

} public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
} private void showIndexPage(HttpServletResponse response)
throws IOException, ServletException {
response.setContentType("text/html; charset=Shift_JIS");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">");
out.println("</head>");
out.println("<body>");
out.println("<applet");
out.println("code     = \"PrintApplet.class\" archive=\"ja.jar,common.jar,client.jar,custom.jar,account.jar\" ");
// out.println("code     = \"PrintApplet.class\"");
out.println("name     = \"TestApplet\"");
out.println("width    = \"800\"");
out.println("height   = \"600\"");
out.println(">");
out.println("</applet>");
out.println("</body>");
out.println("</html>");
}}在WEB中运行时显示一个白框,白框中有一个红色的X.  
 1
java.lang.NoClassDefFoundError: jp/co/ntl/preference/PreferenceInfo
at PrintApplet.init(PrintApplet.java:24)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)