Hack Forums
[Java] Panel not showing in roulette game (help pls) - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Java] Panel not showing in roulette game (help pls) (/showthread.php?tid=4875224)



Panel not showing in roulette game (help pls) - Etho - Jun 21, 2015

I am working on a roulette game for class and don't know what went wrong. It compiles but when I run it the panel just doesn't show up. It would be great if one of you could take a look at my code. And I know that I could use a loop to do a lot of this stuff but for now I just want to get it working.

Edit: Problem fixed, setVisible(true); needed to be moved to after panel.add(MoneyLabel);


* - JavaProfit - Jun 21, 2015

Sorry, but what the hell is:
Code
if(b33 == true) { TotalChecked++; }
      if(b34 == true) { TotalChecked++; }
      if(b35 == true) { TotalChecked++; }
      if(b36 == true) { TotalChecked++; }

      if(Random == 1){ if(b1 == true){ AmountOfMoney = AmountOfMoney - TotalChecked + 36; MoneyEarned = 36 - TotalChecked ; JOptionPane.showMessageDialog(this,"Congratulations you won $" + (36-TotalChecked)); }   }
      if(Random == 2){ if(b2 == true){ AmountOfMoney = AmountOfMoney - TotalChecked + 36; MoneyEarned = 36 - TotalChecked ; JOptionPane.showMessageDialog(this,"Congratulations you won $" + (36-TotalChecked)); }   }
      if(Random == 3){ if(b3 == true){ AmountOfMoney = AmountOfMoney - TotalChecked + 36; MoneyEarned = 36 - TotalChecked ; JOptionPane.showMessageDialog(this,"Congratulations you won $" + (36-TotalChecked)); }   }
      if(Random == 4){ if(b4 == true){ AmountOfMoney = AmountOfMoney - TotalChecked + 36; MoneyEarned = 36 - TotalChecked ; JOptionPane.showMessageDialog(this,"Congratulations you won



* - badvibes - Jun 21, 2015

(Jun 21, 2015 06:31 PM)Systemic Wrote:  Sorry, but what the hell is:
Code
if(b33 == true) { TotalChecked++; }
      if(b34 == true) { TotalChecked++; }
      if(b35 == true) { TotalChecked++; }
      if(b36 == true) { TotalChecked++; }

      if(Random == 1){ if(b1 == true){ AmountOfMoney = AmountOfMoney - TotalChecked + 36; MoneyEarned = 36 - TotalChecked ; JOptionPane.showMessageDialog(this,"Congratulations you won $" + (36-TotalChecked)); }   }
      if(Random == 2){ if(b2 == true){ AmountOfMoney = AmountOfMoney - TotalChecked + 36; MoneyEarned = 36 - TotalChecked ; JOptionPane.showMessageDialog(this,"Congratulations you won $" + (36-TotalChecked)); }   }
      if(Random == 3){ if(b3 == true){ AmountOfMoney = AmountOfMoney - TotalChecked + 36; MoneyEarned = 36 - TotalChecked ; JOptionPane.showMessageDialog(this,"Congratulations you won $" + (36-TotalChecked)); }   }
      if(Random == 4){ if(b4 == true){ AmountOfMoney = AmountOfMoney - TotalChecked + 36; MoneyEarned = 36 - TotalChecked ; JOptionPane.showMessageDialog(this,"Congratulations you won
good code

u woldnt no about it


* - sdk - Jun 22, 2015

(Jun 21, 2015 07:33 PM)badvibes Wrote:  good code

u woldnt no about it

Know* <3

But no thats not that great quite a bit of redundancy.


* - sdk - Jun 22, 2015

(Jun 22, 2015 05:54 AM)badvibes Wrote:  u correct no but u don't correct u or woldnt

fk u thts good code

Your fucking spelling is horrible.


* - sdk - Jun 22, 2015

(Jun 22, 2015 05:58 AM)badvibes Wrote:  fk u u dnt no my story
or my lief

i came
i conkered

I hope you are trolling, now go somewhere no one likes a troll that doesn't know good code.


* - badvibes - Jun 22, 2015

(Jun 22, 2015 05:59 AM)Skits Vicious Wrote:  I hope you are trolling, now go somewhere no one likes a troll that doesn't know good code.

mfw my spellin is almost as bad ur code
http://pastebin.com/zFfzzcMT