@Override public void actionPerformed(ActionEvent e) { if (pitchPane.getRotate() < 10 && pitchPane.getRotate() > -10 && side) { pitchPane.setRotate(pitchPane.getRotate() + 1); rolePane.setRotate(rolePane.getRotate() - 1); } if (pitchPane.getRotate() == 10) { pitchPane.setRotate(pitchPane.getRotate() - 1); rolePane.setRotate(rolePane.getRotate() - 1); side = false; } if (pitchPane.getRotate() < 10 && pitchPane.getRotate() > -10 && !side) { pitchPane.setRotate(pitchPane.getRotate() - 1); rolePane.setRotate(rolePane.getRotate() + 1); } if (pitchPane.getRotate() == -10) { side = true; pitchPane.setRotate(pitchPane.getRotate() + 1); rolePane.setRotate(rolePane.getRotate() + 1); } }
public void updateAngle() { pitchLabel.setText(String.valueOf(pitchPane.getRotate())); roleLabel.setText(String.valueOf(rolePane.getRotate())); }