title: How to add color to the lines when using arrowkeys?
body: <p>The program will create lines according to which arrow key the user is pressing. I want to change the color from (default) black to red when the user presses the up key. What is wrong with this format?</p>
  
  <pre><code> private void moveUp() {
      pane.getChildren().add(new Line(cX, cY, cX, cY - 10));
      cY -= 10;
  
      Line sLine = new Line(cX, cY, cX, cY - 10);
      sLine.setStroke(Color.RED);
  </code></pre>