在NoClassDefFoundError的Java小程序上的invokeLater() [英] NoClassDefFoundError in Java Applet on invokeLater()

查看:132
本文介绍了在NoClassDefFoundError的Java小程序上的invokeLater()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小程序,我使用NetBeans建成,被称为AKApplet。它运行在IDE很好,但是当我把它放在一个网页,它抛出了以下错误:

I have an applet I've built using NetBeans, called AKApplet. It runs fine in the IDE, but when I put it in a web page it throws the following error:

Exception in thread "Thread-15" java.lang.NoClassDefFoundError: AKApplet$2
    at AKApplet.run(AKApplet.java:675)

小程序使用run()方法,同时保持用户界面响应在后台加载一些数据。 pretty标准的东西。在行675,数据被加载后,我试图用更新UI组件的invokeLater()

public void run() {

    // ... data loads ...

    // line 675:
    javax.swing.SwingUtilities.invokeLater(new Runnable() {

        public void run() {
            userMessages.setText("Data loaded.");
            panelList.setVisible(true);
            validate();
            }
    });

}

我试图更新的组件是 userMessages ,一个JLabel和小组成员这是一个面板。我不认为它越来越远但是。

The components I'm trying to update are userMessages, a JLabel and panelList which is a Panel. I don't think it's getting that far however.

有谁知道什么可能发生?在这一点上的小程序加载以及组件可以看到和已被更新,等等。

Does anyone know what might be happening? At this point the applet has loaded and the components can be seen and have been updated, etc.

推荐答案

请确保您部署不仅 AKApplet.class ,也 AKApplet $ 1.class AKApplet $ 2.class

Make sure you're deploying not only AKApplet.class, but also AKApplet$1.class, AKApplet$2.class, etc.

这篇关于在NoClassDefFoundError的Java小程序上的invokeLater()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆