public void selectWater() throws IOException {
FXMLLoader loader = new FXMLLoader(
JBot.class.getResource("Select.fxml"));
AnchorPane selectDialog = (AnchorPane) loader.load();
final Stage stage = new Stage();
stage.initStyle(StageStyle.TRANSPARENT);
Scene scene = new Scene(selectDialog);
stage.setScene(scene);
stage.setOpacity(0.1);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
stage.setWidth(screenSize.getWidth());
stage.setHeight(screenSize.getHeight());
stage.show();
scene.setOnMousePressed(new EventHandler<MouseEvent>() {
public void handle(MouseEvent me) {
fishX0 = (int) me.getScreenX();
fishY0 = (int) me.getScreenY();
}
});
scene.setOnMouseReleased(new EventHandler<MouseEvent>() {
public void handle(MouseEvent me) {
fishX1 = (int) me.getScreenX();
fishY1 = (int) me.getScreenY();
fishDelay = Integer.parseInt(delay.getText());
timez = Integer.parseInt(times.getText());
prop.setProperty("fishX0", Integer.toString(fishX0));
prop.setProperty("fishY0", Integer.toString(fishY0));
prop.setProperty("rodX", Integer.toString(rodX));
prop.setProperty("rodY", Integer.toString(rodY));
if (delay.getText() != null || delay.getText().equalsIgnoreCase("")); {
prop.setProperty("fishDelay", delay.getText());
}
if (times.getText() != null || times.getText().equalsIgnoreCase("")) {
prop.setProperty("times", times.getText());
}
prop.setProperty("fishX1", Integer.toString(fishX1));
prop.setProperty("fishY1", Integer.toString(fishY1));
try {
prop.store(new FileOutputStream("config.properties"), null);
stage.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}