Need help urgent.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • araunity2005
    New Member
    • Oct 2006
    • 2

    #1

    Need help urgent.

    I badly need help in makinga program to the following solution and I have no idea how to do it.Can someone please help me. The link is to the content which was given for practise before exams, It is Lab 6 Simple Graphics in Java.



    Can someone pls help me with this.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by araunity2005
    I badly need help in makinga program to the following solution and I have no idea how to do it.Can someone please help me. The link is to the content which was given for practise before exams, It is Lab 6 Simple Graphics in Java.



    Can someone pls help me with this.
    Please save everyone their bandwidth and time by posting you problem here not linking to it. Some of us have work to attend too. And what if the person who can best help you does not have a pdf viewer?

    Comment

    • araunity2005
      New Member
      • Oct 2006
      • 2

      #3
      Sorry about that...

      This is what the problem is specifically.

      Work to be Done

      a) Display a blue circle in th ecenter of a frame.

      b) You may then press th eleft mouse down when the cursor is either on the perimeter of the circle or when it is inside the circle.

      c) If the cursor is on the perimeter when you press the left mouse button , the color of the circle should become red.You can now move the mouse with the left mouse button pressed down (i.e., drag the mouse). The perimeter of th ecircle should always move with the cursor, so that the size of the circle becomes smaller.As you move the cursor towards the center of the circle or larger as you move the cursor away from the center of the circle.When you release th eleft mouse button , the color of the circle should become blue again but the size of the circle should remain the same as the circle you had when you released the left mouse button.

      d) If the cursor is inside the circle when you pressed th eleft mouse button,the color of the circle should become green. You can now drag the mouse. The green circle should always move with the cursor,The size of the circle should not change,When you release the left mouse button, the color of the cirlce should become blue again.

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by araunity2005
        Sorry about that...

        This is what the problem is specifically.

        Work to be Done

        a) Display a blue circle in th ecenter of a frame.

        b) You may then press th eleft mouse down when the cursor is either on the perimeter of the circle or when it is inside the circle.

        c) If the cursor is on the perimeter when you press the left mouse button , the color of the circle should become red.You can now move the mouse with the left mouse button pressed down (i.e., drag the mouse). The perimeter of th ecircle should always move with the cursor, so that the size of the circle becomes smaller.As you move the cursor towards the center of the circle or larger as you move the cursor away from the center of the circle.When you release th eleft mouse button , the color of the circle should become blue again but the size of the circle should remain the same as the circle you had when you released the left mouse button.

        d) If the cursor is inside the circle when you pressed th eleft mouse button,the color of the circle should become green. You can now drag the mouse. The green circle should always move with the cursor,The size of the circle should not change,When you release the left mouse button, the color of the cirlce should become blue again.
        Well then let's get started. You write the code for displaying the blue circle. Use a Canvas inside a JFrame. If you feel you are not yet that good at mouse events, we might as well end at just drawing the blue dot and continue tommorrow when you've had a look at mouse events and mouse motion events (If you have the time).

        Comment

        Working...