'else' without 'if' eg. else if(Label.equals("Lightgray")). if there are different options eg. if(Label.equals("Yellow"))you cant just have 'if' can you!
You can indeed have just "if" -- the syntax of a chain of if/else statements looks like
There's no "else" before the very first "if". Often the "else without if" message comes from leaving out the braces above that group statements together -- for example, this code would give you that message:
Also: 'illegal start of expression' eg. public boolean action(Event evt, object arg)how is this illegal!
This would be illegal if it appeared in the middle of a method. You might be trying to write this at the top level of a class, but you left out a closing brace at the end of the method just before -- that makes it look as if this line is inside a method, and method declarations can't go inside another method.
Also: 'cannot resolve symbol' eg. method setMessage(java.lang.String)
"Cannot resolve symbol" means that the compiler can't find something by a given name. If you are calling the method above and there's no such method, the compiler will say "can't resolve symbol." If you think the method really does exist, you may be trying to call the method on an instance of the wrong class.