Please help with the switch statement for rock paper scissor game using JOptionPane.

Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Please help with the switch statement for rock paper scissor game using JOptionPane.

Please help me out I am the biginner in java.I I suppose to write a program that plays the popular rock-paper game.The program should randomly generate the random number 0,1 or 2 representing the rock, paper or scissor. The program should randomly ask the user to enter number 0,1 or 0 and display the message indicating whether the user or the computer wins or draws.

NOTE: A scissor can cut a paper, a rock can crush a scissor and the paper can wrap a rock.

I am require to use math.random() medhod. To get random number between 0 and 2. I am required to use the following code:
(int)(Math.random() *)

Note: Math.radom return a double value between 0 and 1.

Finally JOptionPane is required for input and out.

Here is what i have sor far but I am getting few bugs. Please help I would reallly appreciate.