For example:

package topdowngame;
public class SpeedDir {
    double speed;
    private double direction;
    static final SpeedDir INTERNAL = new SpeedDir(1,45);
// Other stuff

If I write a code like this and excute it when I click:

player.speedDir = SpeedDir.INTERNAL;

It only works the first time I click. I have no idea why.

>It only works the first time I click. I have no idea why.
INTERNAL is qualified with static modifier.
Look at

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.