That's close. But you shouldn't declare Xposition again. It is already part of the Square class, so you just say:
public static void setXposition(double x){
Xposition = x;
}
Then...
Type: Posts; User: pbrockway2
That's close. But you shouldn't declare Xposition again. It is already part of the Square class, so you just say:
public static void setXposition(double x){
Xposition = x;
}
Then...
Sorry for the late post. I only meant that class names should start with a big (uppercase) letter: like MyPanel, Square. ("small" == a minor thing that is not the cause of your problem).
Small point, but classes should begin with a capital letter like Square.
You can't access local variables in main() - or other methods - from different places in the code. So make what you want...