package TravaMouse;
import java.io.IOException;
import javax.swing.JOptionPane;
import com.jfoenix.controls.JFXToggleButton;
import com.sun.glass.ui.Robot;
import javafx.application.Application;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class travaMouse extends Application {
@FXML JFXToggleButton tb = new JFXToggleButton();
Robot bot = com.sun.glass.ui.Application.GetApplication().createRobot();
static Stage stage;
AnchorPane root;
KeyEvent event;
@Override
public void start(Stage primaryStage) throws IOException {
stage=primaryStage;
root = FXMLLoader.load(getClass().getResource("FXMLtravamouse.fxml"));
Scene cena = new Scene(root);
stage.setScene(cena);
stage.show();
}
public void trava() {
if(tb.isSelected()) {
while(event.getCode()==KeyCode.ENTER) {
bot.mouseMove(500, 500);
}
}
}
public static void main(String[] args) {
launch(args);
}
}
Por que não consigo fazer essa ação rodar?