0
if((wort[0] == "A") && (wort[1] == "P") && (wort[2] == "F") && (wort[3] == "E") && (wort[4] == "L") && (wort[5] == "K") && (wort[6] == "U") && (wort[7] == "C") && (wort[8] == "H") && (wort[9] == "E") && (wort[10] == "N")) {

        frame.remove(panel);
        frame.add(winpanel);
        winpanel.add(winmeldung);
        winpanel.add(beenden);
        frame.validate();

嗨,我在这里有一个巨大的项目,所以我将只发布其中的一部分。我想检查一些东西,如果它是真的,应该打开一个新面板。但是每次我运行我都会因为“未知来源”而出错。为什么??

编辑:

错误:

at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
4

1 回答 1

6

肯定错的一件事是:

wort[0] == "A"

应该

wort[0].equals( "A")

String比较总是应该使用equals()代替==(字符串文字比较的情况除外)

关于更新的异常,请参阅(或)讨论可能会有所帮助。

于 2012-11-14T16:24:45.367 回答