--%>

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 : Explain the benefits of distributed

    Explain the benefits of distributed systems.

  • Q : Use of System Dynamic and System Runtime

    What is the use of System.Dynamic and System.Runtime.CompilerServices namespaces?

  • Q : Reducing state space of code What is

    What is the way to reduce the state space of the code during model checking?

  • Q : How can we start Array Index from Zero

    How can we start Array Index from Zero?

  • Q : Simple Sorting Program in C Shell

    Assignment: Sorting You will write a simple sorting program. This program should be invoked as follows: shell% ./fastsort -i inputfile -o outputfile

  • Q : What is Actual argument Actual argument

    Actual argument: The value of an argument enacted to a method from exterior to the method. Whenever a method is called, the real argument values are copied into analogous formal arguments. The kinds of the actual arguments should be compatible with th

  • Q : What is Bandera Bandera: The main goal

    Bandera: The main goal of Bandera project is to integrate existing programming language processing methods with newly developed methods to provide automated support for the extraction of safe, compact, finite-state models which are suitable for verifi

  • Q : Assembly condition codes What do you

    What do you mean by the term assembly condition codes?

  • Q : Explain Static variable Static variable

    Static variable: It is a static variable defined within a class body. Such a variable fits in to the class as a whole, and is, thus, shared by all objects of the class. The class variable may be employed to define the default value of an instance vari

  • Q : Define User Datagram Protocol User

    User Datagram Protocol: The User Datagram Protocol (abbreviated as UDP) is a set of rules which permit communication among two processes across a network. The protocol is unreliable, that means that information is not guaranteed to be