I'm newbie in java, can you help me to this code.
the image needs to move diagonally
public void actionPerformed(ActionEvent e) {
x += 3;
if (x > 600) {
y = random.nextInt(600);
x = random.nextInt(-45);
star.setX(x);
star.setY(y);
}