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();

Hi, i have a huge Project here, so i will just post a part of it. I wanted to check something and if it's true a new panel should open. But every time I run i get an error because of "Unknown Source". Why??

EDIT:

the error:

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)
Ahmad
  • 69,608
  • 17
  • 111
  • 137
Lennart Schoch
  • 157
  • 2
  • 3
  • 21
  • 1
    Please post the actual error. – thegrinner Nov 14 '12 at 16:25
  • Please edit your question and add the complete stack trace you get. – Robert Nov 14 '12 at 16:25
  • 1
    Where are you getting that error? Please post StackTrace. – Rohit Jain Nov 14 '12 at 16:25
  • 2
    You could use `if( wort.equals( "APFELKUCHEN" ) )` – Esailija Nov 14 '12 at 16:26
  • 1
    - What do you mean with "run"? Compile or execute? - Where is the end of the "if" statement? - What type of is wort? – mrab Nov 14 '12 at 16:26
  • The stack trace doesn't even mention any of your code. “Unknown Source” simply means that there is no information available as to what source code file from the java libraries this stack frame belongs to. The line before the `at …` should have given you more details about what the error actually *is.* – MvG Nov 14 '12 at 16:37

1 Answers1

6

One thing for sure wrong is:

wort[0] == "A"

should be

wort[0].equals( "A")

String comparison always should use equals() instead of == (except case of String literal comparison)

Regarding updated exception, see this (or) this discussion may help.

Community
  • 1
  • 1
kosa
  • 65,990
  • 13
  • 130
  • 167