--%>

Create an applet of bounces in JAVA

Create an applet that bounces a blue ball inside an applet using Thread.  The ball (diameter is 10) will start at position (0,0).  When the ball hits the edge of the applet, the ball should bounce off the edge at a randomly selected angle between 20 and 60 degrees  (Hint:  increase/decrease the x or y value by a random number of 2 to 6). Again, you must use the exact values that I stated in the questions to get credits.

More Hint:  When the ball hits the left edge (i.e. x <= 0), the x value should be increased.  When the ball hits the bottom edge, the y value should be decreased.

Bonus:  When the user click the mouse inside the applet, the ball will be suspended.  When the user click the mouse again, the ball will resume the motion but going in another direction.

 

 

   Related Questions in Programming Languages

  • Q : Define the term Scheduler Define the

    Define the term Scheduler: The portion of the Java Virtual Machine (abbreviated as JVM) which is responsible for managing the threads.

  • Q : Explain Wrapper classes Wrapper

    Wrapper classes: The Java's primitive types are not of object types. The wrapper classes are stated in the java.lang package. They comprises of a class for each and every primitive type: Boolean, Byte, Double, Float, Integer, Long & Short and Char

  • Q : Main function of context switching What

    What is the main function of context switching?

  • Q : Define Compilation Compilation : It is

    Compilation: It is a process of translating a programming language. This frequently comprises translating a high level programming language into a low level programming language, and the binary form of a specific instruction set. The translation is ex

  • Q : Examples for 8 -16 - 32 bit

    Normal 0 false false

  • Q : How can Login dialog accessed The web

    The web page I am testing displays the Login dialog. How can I access this dialog?

  • Q : Explain VeriSoft VeriSoft (Godefroid,

    VeriSoft (Godefroid, 2005) is a model checker for C and C++; other languages can be used, but components in other languages are treated as black boxes. VeriSoft has been used to find defects in very large telecommunications programs (Chandra, Godefroi

  • Q : Explain the way to handle the mapping

    Explain the way to handle the mapping form.

  • Q : What are Relational operators

    Relational operators: Operators, like <, >, <=, >=, == and!=, which produce a Boolean outcome, as portion of a Boolean expression.

  • Q : Define HyperText Markup Language

    HyperText Markup Language: The HyperText Markup Language (abbreviated as HTML) is a simple presentation language employed to markup the content of the Web pages. Its tags appear frequently in pairs to mark sections of text which must be represented in