Search:

Type: Posts; User: Norm

Search: Search took 0.20 seconds.

  1. Replies
    9
    Views
    2,046

    Re: Moving a shape across a panel

    To help you see what the JSlider methods do, add a println statement in the listener method and print out the values that the JSlider class methods return as you move the slider around.
  2. Replies
    9
    Views
    2,046

    Re: Moving a shape across a panel

    Make radius final and you won't be able to change it.

    Your code is not using any values from the slider to change the x & y values of the shape's location.
    Look at the JSlider class's API doc for...
  3. Replies
    9
    Views
    2,046

    Re: Moving a shape across a panel

    Does the size of the drawn shape change?

    Where do you change the value of the x and y position of the shape? Is its position supposed to change when a slider is moved?
  4. Replies
    9
    Views
    2,046

    Re: Moving a shape across a panel

    What is the setD method supposed to do? Why does it change the value of radius? Do you know what a circle's radius is?

    If you want the sliders to control the position of the shape, then you need...
  5. Replies
    9
    Views
    2,046

    Re: Moving a shape across a panel

    If you want the size of the shape not to change, try defining the radius as final and remove all code that tries to change its value . Only change the x and y position values.


    BTW The code you...
Results 1 to 5 of 5