This is probably a simple error, but I can't figure it out. I can call getText on TextArea controls just fine, but TextField controls are constantly thowing an InvocationTargetException error. They are both defined in the same way and I've triple checked the FX IDs and controller is correct. Not sure what else could cause this. Please help!
Relevant FXML - Root Node
<VBox prefHeight="500.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="api.LayoutController">
Field FXML
<TextField fx:id="apitoken" text="mytopsecrettoken" GridPane.columnIndex="1">
<GridPane.margin><Insets /></GridPane.margin></TextField>
Controller:
public class LayoutController implements Initializable {
@FXML
private TextArea result,data;
private TextField apitoken,object;
@FXML
private void submit(ActionEvent event) {
result.setText(apitoken.getText());
}
Exception information:
Executing C:\Users\XXX\Documents\NetBeansProjects\API\dist\run1375954609\API.jar using platform C:\Program Files\Java\jdk1.8.0_05\jre/bin/java
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1768)
at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1651)