title: JavaFX getting input from a textfield
body: <p>I have just started learning java fx and I am trying to get user input from two text field. Once they click the button this will be displayed on a console.
  However, I am keep getting an error and cannot figure out why. 
  I have assigned the 'handle' function using Scenebuilder, the error is pointing at the method.</p>
  
  <p>Main Class:</p>
  
  <pre><code>package sample;
  
  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 {
  
  @Override
  public void start(Stage primaryStage) throws Exception{
      Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
      primaryStage.setTitle("Hello World");
      primaryStage.setScene(new Scene(root, 300, 275));
      primaryStage.show();
  }
  
  
  public static void main(String[] args) {
      launch(args);
  }
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>package sample;
  
  import javafx.event.ActionEvent;
  import javafx.scene.control.Button;
  import javafx.scene.control.TextField;
  
  public class Controller {
  public TextField userField;
  public TextField passField;
  public Button logButton;
  
  public void handle(ActionEvent event) {
      String username = userField.getText();
      String passw = passField.getText();
      System.out.printf("Logged in as %s %s", username, passw);
  
  }
  
  }
  </code></pre>