~HELP!! ASAP~

Started by Chaze007, July 10, 2009, 03:43:28 pm

Previous topic - Next topic

Chaze007

July 10, 2009, 03:43:28 pm Last Edit: July 10, 2009, 04:11:34 pm by Chaze007
Yeah Yeah where have I been and such, right now I need epic help with Java coding
For some reason, when i compile this code i get an error such as
if(cmd.equals("Red)
^
Spoiler: ShowHide

some retarded error.
Here's the code if anyone can help
  if(cmd.equals("red"))
       {
           try{UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceMagmaLookAndFeel")
       }
       if(cmd.equals("Blue"))
       {
           try{UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessBlueSteelLookAndFeel")
       }
       }
       if(cmd.equals("Black"))
       {
           try{UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessBlackSteelLookAndFeel")
       }
       if(cmd.equals("Green"))
       {
           try{UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceEmeraldDuskLookAndFeel")
       }
       if(cmd.equals("White"))
       {
           try{UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceCremeLookAndFeel")
       }
       if(cmd.equals("Grey"))
       {
           try{UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceMistAquaLookAndFeel")
       }
Always I Wanna Be With You! Make Believe With You!

Blizzard

What now? Does a try block need {} or not? At a few places opened the brackets, but never closed them.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

winkio

A try block needs both {} and a catch(){} block.  I already went over it with him.  It seems that he doesn't have all the necessary resources that this GUI uses, because after we fixed this part, he got like 40-some errors.

legacyblade

        if(cmd.equals("Blue"))
        {
            try{UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessBlueSteelLookAndFeel")
        }
        }


there's your error. Get rid of the last } and it should work.

fugibo

Quote from: legacyblade on July 12, 2009, 04:41:05 pm
        if(cmd.equals("Blue"))
        {
            try{UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessBlueSteelLookAndFeel")
        }
        }


there's your error. Get rid of the last } and it should work.


Not necessarily. The original used wrong indentation every other line >_>

winkio

guys, the whole thing is messed up.  I already went over it with him.  The one dead giveaway is that there aren't any semicolons. :roll:

fugibo

Quote from: winkio on July 12, 2009, 05:27:09 pm
guys, the whole thing is messed up.  I already went over it with him.  The one dead giveaway is that there aren't any semicolons. :roll:


lawlz. I didn't even look at it that hard, I just asked for the full file and cried at it. =P

Maybe I should invest some time into learning to actually focus on the code I'm working on, hmm...