gpt4 book ai didi

Java Applet Web 部署问题

转载 作者:行者123 更新时间:2023-11-30 09:36:48 25 4
gpt4 key购买 nike

我在使用 netbeans 将 JApplet 部署到正常工作的 Web 服务器时遇到了问题。发生的事情是它似乎加载了小程序,但加载后我只剩下一个空白屏幕,没有按钮。我认为这可能是因为我使用的是卡片布局设计,或者是因为所需的库未包含在 .jar 中。我正在使用 Atmos 包装函数和一些外部 .jar 文件。

任何帮助都会很棒!如果您需要更多信息,请询问!

public void init() {

// initialise any variable we have created
cloud = new CloudClass();
user = new User();
sourceFiles = null;
dest = null;

/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and feel. For details see
* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(ArFileJApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(ArFileJApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(ArFileJApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(ArFileJApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>

/*
* Create and display the applet
*/
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {

public void run() {
// initialise any previously uninitialised variables
initComponents();
invalidLogin_label.setVisible(false);
}
});
} catch (Exception ex) {
ex.printStackTrace();
}
}

编辑:我做了一些调整,现在小程序页面只是在网页上出现错误,显示“错误,点击查看详细信息”

点击这里显示 com/emc/esu/api/EsuException 并点击 Details 按钮给我一些调试选项,这可能对所有知识渊博的类型都有帮助..

c: 清除控制台窗口f: 终结队列中的对象g:垃圾收集h:显示此帮助信息l:转储类加载器列表m:打印内存使用情况o:触发记录q:隐藏控制台r:重新加载策略配置s:转储系统和部署属性t:转储线程列表v: 转储线程栈x: 清除类加载器缓存0-5:设置跟踪级别为

最佳答案

最有可能出现两个问题:

  • 在类路径中找不到所需的 jar,因此它会因某种错误而爆炸。在这种情况下,您需要找出如何查看 ClassNotFoundException 并从那里解决它。
  • 您的用户界面在加载后没有刷新/布局不正确。请参阅:Applet works, but swing components won't appear!

关于Java Applet Web 部署问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10645518/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com