Chaos Project

General => Electronic and Computer Section => Programming / Scripting / Web => Topic started by: Chaze007 on July 10, 2009, 03:43:28 pm

Title: ~HELP!! ASAP~
Post by: Chaze007 on July 10, 2009, 03:43:28 pm
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
(http://i31.tinypic.com/qq8y2o.jpg)

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")
       }
Title: Re: ~HELP!! ASAP~
Post by: Blizzard on July 12, 2009, 07:12:33 am
What now? Does a try block need {} or not? At a few places opened the brackets, but never closed them.
Title: Re: ~HELP!! ASAP~
Post by: winkio on July 12, 2009, 10:55:53 am
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.
Title: Re: ~HELP!! ASAP~
Post by: 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.
Title: Re: ~HELP!! ASAP~
Post by: fugibo on July 12, 2009, 05:13:12 pm
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 >_>
Title: Re: ~HELP!! ASAP~
Post by: 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:
Title: Re: ~HELP!! ASAP~
Post by: fugibo on July 12, 2009, 06:22:52 pm
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...