title: How do you create a new object in a javafx scene?
body: <p>I cannot seem to add a new object to my scene. Right now i have when you click on a green square it runs the method select and when you click on a button it runs the newcity method and is supposed to create a blue square. I have tried adding my rectangle to the parent but i always get errors. In the code below getChildren() in the City Class is underlined in red!</p>
  
  <p>Here is my code:<br>
  Main Class:</p>
  
  <pre><code>package application;
  
  import javafx.application.Application;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.stage.Stage;
  
  
  public class Main extends Application {
      public void start(Stage primaryStage) {
          try {
              Parent root = FXMLLoader.load(getClass().getResource("/fxml/Map1.fxml"));
              Scene scene = new Scene(root,576,352);
              scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
              primaryStage.setResizable(false);
              primaryStage.setScene(scene);
              primaryStage.setTitle("Map");
              primaryStage.show();
          } catch(Exception e) {
              e.printStackTrace();
          }
      }
  
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>
  
  <p>MainControl Class:</p>
  
  <pre><code>package application;
  
  import java.net.URL;
  import java.util.ArrayList;
  import java.util.ResourceBundle;
  
  import javafx.event.ActionEvent;
  import javafx.event.Event;
  import javafx.fxml.Initializable;
  import javafx.scene.Node;
  import javafx.scene.shape.Rectangle;
  
  public class MainControl implements Initializable {
      boolean selected = false;
      Node selectnode;
      public void initialize(URL arg0, ResourceBundle arg1) {
      };
  
      public void select(Event event) {
          selectnode = (Node) event.getSource();
          selected = true;
      }
      public void newcity(ActionEvent event){
          City ncity = new City();
          ncity.newcity(selectnode.getLayoutX(), selectnode.getLayoutY(),
                  selectnode, event);
      }
  }
  </code></pre>
  
  <p>City Class:</p>
  
  <pre><code>package application;
  
  import javafx.event.ActionEvent;
  import javafx.scene.Node;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.scene.shape.Rectangle;
  
  public class City {
      public void newcity(double x,double y, Node n,ActionEvent event){
  
          Rectangle cityshape = new Rectangle(n.getLayoutX(), n.getLayoutY(),32, 32);
          Parent root = n.getParent();
          root.getChildren().add(cityshape); //getChildren() is underlined in red
      }
  }
  </code></pre>
  
  <p>Map1 FXML:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
      &lt;?import javafx.scene.image.*?&gt;
      &lt;?import javafx.scene.*?&gt;
      &lt;?import javafx.scene.effect.*?&gt;
      &lt;?import javafx.scene.shape.*?&gt;
      &lt;?import javafx.scene.control.*?&gt;
      &lt;?import javafx.scene.text.*?&gt;
      &lt;?import java.lang.*?&gt;
      &lt;?import javafx.scene.layout.*?&gt;
  
      &lt;AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="352.0" prefWidth="576.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.MainControl"&gt;
         &lt;children&gt;
    &lt;TextField fx:id="textBox" layoutX="2.0" opacity="0.01" prefHeight="352.0" prefWidth="576.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"&gt;
       &lt;cursor&gt;
          &lt;Cursor fx:constant="DEFAULT" /&gt;
       &lt;/cursor&gt;
       &lt;effect&gt;
          &lt;ColorAdjust /&gt;
       &lt;/effect&gt;
    &lt;/TextField&gt;
    &lt;Rectangle fx:id="tile1" fill="#26b522" height="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile20" fill="#26b522" height="32.0" layoutX="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile2" fill="#26b522" height="32.0" layoutX="64.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile3" fill="#26b522" height="32.0" layoutX="96.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile4" fill="#26b522" height="32.0" layoutX="128.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile5" fill="#26b522" height="32.0" layoutX="160.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile6" fill="#26b522" height="32.0" layoutX="192.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile7" fill="#26b522" height="32.0" layoutX="224.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile8" fill="#26b522" height="32.0" layoutX="256.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile9" fill="#26b522" height="32.0" layoutX="288.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile10" fill="#26b522" height="32.0" layoutX="320.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile101" fill="#26b522" height="32.0" layoutX="320.0" layoutY="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile91" fill="#26b522" height="32.0" layoutX="288.0" layoutY="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile81" fill="#26b522" height="32.0" layoutX="256.0" layoutY="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile71" fill="#26b522" height="32.0" layoutX="224.0" layoutY="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile61" fill="#26b522" height="32.0" layoutX="192.0" layoutY="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile51" fill="#26b522" height="32.0" layoutX="160.0" layoutY="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile41" fill="#26b522" height="32.0" layoutX="128.0" layoutY="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile31" fill="#26b522" height="32.0" layoutX="96.0" layoutY="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile21" fill="#26b522" height="32.0" layoutX="64.0" layoutY="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile30" fill="#26b522" height="32.0" layoutX="32.0" layoutY="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile11" fill="#26b522" height="32.0" layoutY="32.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile102" fill="#26b522" height="32.0" layoutX="320.0" layoutY="64.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile92" fill="#26b522" height="32.0" layoutX="288.0" layoutY="64.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile82" fill="#26b522" height="32.0" layoutX="256.0" layoutY="64.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile72" fill="#26b522" height="32.0" layoutX="224.0" layoutY="64.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile62" fill="#26b522" height="32.0" layoutX="192.0" layoutY="64.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile52" fill="#26b522" height="32.0" layoutX="160.0" layoutY="64.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile42" fill="#26b522" height="32.0" layoutX="128.0" layoutY="64.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile32" fill="#26b522" height="32.0" layoutX="96.0" layoutY="64.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile22" fill="#26b522" height="32.0" layoutX="64.0" layoutY="64.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile40" fill="#26b522" height="32.0" layoutX="32.0" layoutY="64.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile12" fill="#26b522" height="32.0" layoutY="64.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile103" fill="#26b522" height="32.0" layoutX="320.0" layoutY="96.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile93" fill="#26b522" height="32.0" layoutX="288.0" layoutY="96.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile83" fill="#26b522" height="32.0" layoutX="256.0" layoutY="96.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile73" fill="#26b522" height="32.0" layoutX="224.0" layoutY="96.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile63" fill="#26b522" height="32.0" layoutX="192.0" layoutY="96.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile53" fill="#26b522" height="32.0" layoutX="160.0" layoutY="96.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile43" fill="#26b522" height="32.0" layoutX="128.0" layoutY="96.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile33" fill="#26b522" height="32.0" layoutX="96.0" layoutY="96.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile23" fill="#26b522" height="32.0" layoutX="64.0" layoutY="96.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile50" fill="#26b522" height="32.0" layoutX="32.0" layoutY="96.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile13" fill="#26b522" height="32.0" layoutY="96.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile104" fill="#26b522" height="32.0" layoutX="320.0" layoutY="128.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile94" fill="#26b522" height="32.0" layoutX="288.0" layoutY="128.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile84" fill="#26b522" height="32.0" layoutX="256.0" layoutY="128.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile74" fill="#26b522" height="32.0" layoutX="224.0" layoutY="128.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile64" fill="#26b522" height="32.0" layoutX="192.0" layoutY="128.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile54" fill="#26b522" height="32.0" layoutX="160.0" layoutY="128.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile44" fill="#26b522" height="32.0" layoutX="128.0" layoutY="128.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile34" fill="#26b522" height="32.0" layoutX="96.0" layoutY="128.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile24" fill="#26b522" height="32.0" layoutX="64.0" layoutY="128.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile60" fill="#26b522" height="32.0" layoutX="32.0" layoutY="128.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile14" fill="#26b522" height="32.0" layoutY="128.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile105" fill="#26b522" height="32.0" layoutX="320.0" layoutY="160.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile95" fill="#26b522" height="32.0" layoutX="288.0" layoutY="160.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile85" fill="#26b522" height="32.0" layoutX="256.0" layoutY="160.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile75" fill="#26b522" height="32.0" layoutX="224.0" layoutY="160.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile65" fill="#26b522" height="32.0" layoutX="192.0" layoutY="160.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile55" fill="#26b522" height="32.0" layoutX="160.0" layoutY="160.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile45" fill="#26b522" height="32.0" layoutX="128.0" layoutY="160.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile35" fill="#26b522" height="32.0" layoutX="96.0" layoutY="160.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile25" fill="#26b522" height="32.0" layoutX="64.0" layoutY="160.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile70" fill="#26b522" height="32.0" layoutX="32.0" layoutY="160.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile15" fill="#26b522" height="32.0" layoutY="160.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile106" fill="#26b522" height="32.0" layoutX="320.0" layoutY="192.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile96" fill="#26b522" height="32.0" layoutX="288.0" layoutY="192.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile86" fill="#26b522" height="32.0" layoutX="256.0" layoutY="192.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile76" fill="#26b522" height="32.0" layoutX="224.0" layoutY="192.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile66" fill="#26b522" height="32.0" layoutX="192.0" layoutY="192.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile56" fill="#26b522" height="32.0" layoutX="160.0" layoutY="192.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile46" fill="#26b522" height="32.0" layoutX="128.0" layoutY="192.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile36" fill="#26b522" height="32.0" layoutX="96.0" layoutY="192.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile26" fill="#26b522" height="32.0" layoutX="64.0" layoutY="192.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile80" fill="#26b522" height="32.0" layoutX="32.0" layoutY="192.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile16" fill="#26b522" height="32.0" layoutY="192.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile107" fill="#26b522" height="32.0" layoutX="320.0" layoutY="224.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile97" fill="#26b522" height="32.0" layoutX="288.0" layoutY="224.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile87" fill="#26b522" height="32.0" layoutX="256.0" layoutY="224.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile77" fill="#26b522" height="32.0" layoutX="224.0" layoutY="224.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile67" fill="#26b522" height="32.0" layoutX="192.0" layoutY="224.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile57" fill="#26b522" height="32.0" layoutX="160.0" layoutY="224.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile47" fill="#26b522" height="32.0" layoutX="128.0" layoutY="224.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile37" fill="#26b522" height="32.0" layoutX="96.0" layoutY="224.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile27" fill="#26b522" height="32.0" layoutX="64.0" layoutY="224.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile90" fill="#26b522" height="32.0" layoutX="32.0" layoutY="224.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile17" fill="#26b522" height="32.0" layoutY="224.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile108" fill="#26b522" height="32.0" layoutX="320.0" layoutY="256.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile98" fill="#26b522" height="32.0" layoutX="288.0" layoutY="256.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile88" fill="#26b522" height="32.0" layoutX="256.0" layoutY="256.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile78" fill="#26b522" height="32.0" layoutX="224.0" layoutY="256.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile68" fill="#26b522" height="32.0" layoutX="192.0" layoutY="256.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile58" fill="#26b522" height="32.0" layoutX="160.0" layoutY="256.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile48" fill="#26b522" height="32.0" layoutX="128.0" layoutY="256.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile38" fill="#26b522" height="32.0" layoutX="96.0" layoutY="256.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile28" fill="#26b522" height="32.0" layoutX="64.0" layoutY="256.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile110" fill="#26b522" height="32.0" layoutX="32.0" layoutY="256.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile18" fill="#26b522" height="32.0" layoutY="256.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile109" fill="#26b522" height="32.0" layoutX="320.0" layoutY="288.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile99" fill="#26b522" height="32.0" layoutX="288.0" layoutY="288.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile89" fill="#26b522" height="32.0" layoutX="256.0" layoutY="288.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile79" fill="#26b522" height="32.0" layoutX="224.0" layoutY="288.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile69" fill="#26b522" height="32.0" layoutX="192.0" layoutY="288.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile59" fill="#26b522" height="32.0" layoutX="160.0" layoutY="288.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile49" fill="#26b522" height="32.0" layoutX="128.0" layoutY="288.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile39" fill="#26b522" height="32.0" layoutX="96.0" layoutY="288.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile29" fill="#26b522" height="32.0" layoutX="64.0" layoutY="288.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile120" fill="#26b522" height="32.0" layoutX="32.0" layoutY="288.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="tile19" fill="#26b522" height="32.0" layoutY="288.0" onMouseClicked="#movetest" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Rectangle fx:id="r" arcHeight="15.0" arcWidth="15.0" fill="#ff1f1f" height="32.0" layoutX="256.0" layoutY="160.0" onMouseClicked="#move" stroke="BLACK" strokeType="INSIDE" width="32.0" /&gt;
    &lt;Label layoutX="495.0" layoutY="6.0" prefHeight="17.0" prefWidth="60.0" text="Moves left:" /&gt;
    &lt;Label fx:id="movelabel" layoutX="553.0" layoutY="6.0" prefHeight="17.0" prefWidth="21.0" /&gt;
    &lt;Button mnemonicParsing="false" onAction="#newcity" text="Found City" /&gt;
         &lt;/children&gt;
      &lt;/AnchorPane&gt;
  </code></pre>
  
  <p>Please help<br>
  Thanks</p>