title: JavaFX java.lang.IllegalArgumentException: argument type mismatch [scene builder]
body: <p>I'm using Scene Builder for my Java FXML.</p>
  
  <p>When I run the code, on startup, an IllegalArgumentException is seen, but the program continues to run perfectly.</p>
  
  <p>This is the Controller, mostly generated by Scene Builder (sample controller skeleton).</p>
  
  <p><strong>FXMLDocumentController:</strong></p>
  
  <pre><code>package minerocker_batch_ide_2;
  
  import java.net.URL;
  import java.util.ResourceBundle;
  import javafx.event.ActionEvent;
  import javafx.fxml.FXML;
  import javafx.fxml.Initializable;
  import javafx.scene.control.Button;
  import javafx.scene.control.Label;
  import javafx.scene.control.MenuItem;
  import javafx.scene.control.Tab;
  import javafx.scene.control.TextArea;
  import javafx.scene.control.TextField;
  import javafx.scene.text.Text;
  
  public class FXMLDocumentController implements Initializable {
  
      public int currentTab;
  
      @FXML // ResourceBundle that was given to the FXMLLoader
      private ResourceBundle resources;
  
      @FXML // URL location of the FXML file that was given to the FXMLLoader
      private URL location;
  
      @FXML // fx:id="code4"
      private TextArea code4; // Value injected by FXMLLoader
  
      @FXML // fx:id="code3"
      private TextArea code3; // Value injected by FXMLLoader
  
      @FXML // fx:id="code2"
      private TextArea code2; // Value injected by FXMLLoader
  
      @FXML // fx:id="fileName"
      private TextField fileName; // Value injected by FXMLLoader
  
      @FXML // fx:id="code1"
      private TextArea code1; // Value injected by FXMLLoader
  
      @FXML // fx:id="saveAs"
      private MenuItem saveAs; // Value injected by FXMLLoader
  
      @FXML // fx:id="tab3"
      private Tab tab3; // Value injected by FXMLLoader
  
      @FXML // fx:id="save"
      private MenuItem save; // Value injected by FXMLLoader
  
      @FXML // fx:id="about"
      private MenuItem about; // Value injected by FXMLLoader
  
      @FXML // fx:id="tab4"
      private Tab tab4; // Value injected by FXMLLoader
  
      @FXML // fx:id="tab1"
      private Tab tab1; // Value injected by FXMLLoader
  
      @FXML // fx:id="run"
      private Button run; // Value injected by FXMLLoader
  
      @FXML // fx:id="tab2"
      private Tab tab2; // Value injected by FXMLLoader
  
      @FXML // fx:id="code5"
      private TextArea code5; // Value injected by FXMLLoader
  
      @FXML // fx:id="errorMsg"
      private Button errorMsg; // Value injected by FXMLLoader
  
      @FXML // fx:id="tab5"
      private Tab tab5; // Value injected by FXMLLoader
  
      @FXML // fx:id="lines"
      private Text lines; // Value injected by FXMLLoader
  
      @FXML // fx:id="newN"
      private MenuItem newN; // Value injected by FXMLLoader
  
      @FXML // fx:id="close"
      private MenuItem close; // Value injected by FXMLLoader
  
      @FXML
      void change1(ActionEvent event) {
  
      }
  
      @FXML
      void change2(ActionEvent event) {
  
      }
  
      @FXML
      void change3(ActionEvent event) {
  
      }
  
      @FXML
      void change4(ActionEvent event) {
  
      }
  
      @FXML
      void change5(ActionEvent event) {
  
      }
  
      @FXML
      void newNOnAction(ActionEvent event) {
  
      }
  
      @FXML
      void saveOnAction(ActionEvent event) {
  
      }
  
      @FXML
      void saveAsOnAction(ActionEvent event) {
  
      }
  
      @FXML
      void closeOnAction(ActionEvent event) {
  
      }
  
      @FXML
      void aboutOnAction(ActionEvent event) {
  
      }
  
      @FXML
      void fileNameOnAction(ActionEvent event) {
  
      }
  
      @FXML
      void runOnAction(ActionEvent event) {
  
      }
  
      @FXML
      void errorMsgOnAction(ActionEvent event) {
  
      }
  
      @Override
      public void initialize(URL url, ResourceBundle rb) {
  
      }
  
  }
  </code></pre>
  
  <p><strong>FXMLDocument:</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
      &lt;?import javafx.geometry.*?&gt;
      &lt;?import javafx.scene.text.*?&gt;
      &lt;?import java.lang.*?&gt;
      &lt;?import java.util.*?&gt;
      &lt;?import javafx.scene.*?&gt;
      &lt;?import javafx.scene.control.*?&gt;
      &lt;?import javafx.scene.layout.*?&gt;
  
  
      &lt;BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml" fx:controller="minerocker_batch_ide_2.FXMLDocumentController"&gt;
          &lt;top&gt;
              &lt;VBox prefHeight="72.0" prefWidth="600.0" BorderPane.alignment="CENTER"&gt;
                  &lt;children&gt;
                      &lt;MenuBar&gt;
                          &lt;menus&gt;
                              &lt;Menu mnemonicParsing="false" text="File"&gt;
                                  &lt;items&gt;
                                      &lt;MenuItem fx:id="newN" mnemonicParsing="false" onAction="#newNOnAction" text="New Ctrl + N" /&gt;
                                      &lt;MenuItem fx:id="save" mnemonicParsing="false" onAction="#saveOnAction" text="Save (none)" /&gt;
                                      &lt;MenuItem fx:id="saveAs" mnemonicParsing="false" onAction="#saveAsOnAction" text="Save As Ctrl + S" /&gt;
                                      &lt;MenuItem fx:id="close" mnemonicParsing="false" onAction="#closeOnAction" text="Close" /&gt;
                                  &lt;/items&gt;
                              &lt;/Menu&gt;
                              &lt;Menu mnemonicParsing="false" text="Help"&gt;
                                  &lt;items&gt;
                                      &lt;MenuItem fx:id="about" mnemonicParsing="false" onAction="#aboutOnAction" text="About" /&gt;
                                  &lt;/items&gt;
                              &lt;/Menu&gt;
                          &lt;/menus&gt;
                      &lt;/MenuBar&gt;
                      &lt;ToolBar prefHeight="40.0" prefWidth="200.0"&gt;
                          &lt;items&gt;
                              &lt;TextField fx:id="fileName" onAction="#fileNameOnAction" prefHeight="31.0" prefWidth="147.0" promptText="File Name" /&gt;
                              &lt;Button fx:id="run" mnemonicParsing="false" onAction="#runOnAction" text="Run" /&gt;
                              &lt;Pane prefHeight="0.0" prefWidth="38.0" /&gt;
                              &lt;Button fx:id="errorMsg" mnemonicParsing="false" onAction="#errorMsgOnAction" text="Show Error Message" /&gt;
                          &lt;/items&gt;
                      &lt;/ToolBar&gt;
                  &lt;/children&gt;
              &lt;/VBox&gt;
          &lt;/top&gt;
          &lt;bottom&gt;
              &lt;HBox prefHeight="0.0" prefWidth="600.0" BorderPane.alignment="CENTER"&gt;
                  &lt;children&gt;
                      &lt;Text strokeType="OUTSIDE" strokeWidth="0.0" text="Lines:" /&gt;
                      &lt;Pane prefHeight="21.0" prefWidth="3.0" /&gt;
                      &lt;Text fx:id="lines" strokeType="OUTSIDE" strokeWidth="0.0" text="0" /&gt;
                  &lt;/children&gt;
                  &lt;padding&gt;
                      &lt;Insets bottom="2.0" left="2.0" right="2.0" top="2.0" /&gt;
                  &lt;/padding&gt;
              &lt;/HBox&gt;
          &lt;/bottom&gt;
          &lt;center&gt;
              &lt;GridPane prefHeight="315.0" prefWidth="600.0" BorderPane.alignment="CENTER"&gt;
                  &lt;columnConstraints&gt;
                      &lt;ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /&gt;
                  &lt;/columnConstraints&gt;
                  &lt;rowConstraints&gt;
                      &lt;RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /&gt;
                  &lt;/rowConstraints&gt;
                  &lt;children&gt;
                      &lt;TabPane prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="UNAVAILABLE"&gt;
                          &lt;tabs&gt;
                              &lt;Tab fx:id="tab1" onSelectionChanged="#change1" text="Untitled Tab 1"&gt;
                                  &lt;content&gt;
                                      &lt;TextArea fx:id="code1" prefHeight="200.0" prefWidth="200.0" /&gt;
                                  &lt;/content&gt;
                              &lt;/Tab&gt;
                              &lt;Tab fx:id="tab2" onSelectionChanged="#change2" text="Untitled Tab 2"&gt;
                                  &lt;content&gt;
                                      &lt;TextArea fx:id="code2" prefHeight="200.0" prefWidth="200.0" /&gt;
                                  &lt;/content&gt;
                              &lt;/Tab&gt;
                              &lt;Tab fx:id="tab3" onSelectionChanged="#change3" text="Untitled Tab 3"&gt;
                                  &lt;content&gt;
                                      &lt;TextArea fx:id="code3" prefHeight="200.0" prefWidth="200.0" /&gt;
                                  &lt;/content&gt;
                              &lt;/Tab&gt;
                              &lt;Tab fx:id="tab4" onSelectionChanged="#change4" text="Untitled Tab 4"&gt;
                                  &lt;content&gt;
                                      &lt;TextArea fx:id="code4" prefHeight="200.0" prefWidth="200.0" /&gt;
                                  &lt;/content&gt;
                              &lt;/Tab&gt;
                              &lt;Tab fx:id="tab5" onSelectionChanged="#change5" text="Untitled Tab 5"&gt;
                                  &lt;content&gt;
                                      &lt;TextArea fx:id="code5" prefHeight="200.0" prefWidth="200.0" /&gt;
                                  &lt;/content&gt;
                              &lt;/Tab&gt;
                          &lt;/tabs&gt;
                      &lt;/TabPane&gt;
                  &lt;/children&gt;
              &lt;/GridPane&gt;
          &lt;/center&gt;
      &lt;/BorderPane&gt;
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>Executing C:\Users\21114693\Documents\NetBeansProjects\MineRocker_Batch_IDE_2\dist\run324064419\MineRocker_Batch_IDE_2.jar using platform C:\Program Files\Java\jdk1.8.0_102\jre/bin/java
  Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: argument type mismatch
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
      at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1769)
      at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
      at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
      at javafx.event.Event.fireEvent(Event.java:198)
      at javafx.scene.control.Tab$1.invalidated(Tab.java:209)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:144)
      at javafx.scene.control.Tab.setSelected(Tab.java:185)
      at javafx.scene.control.TabPane$TabPaneSelectionModel.select(TabPane.java:722)
      at javafx.scene.control.TabPane$TabPaneSelectionModel.select(TabPane.java:735)
      at javafx.scene.control.TabPane$TabPaneSelectionModel.findNearestAvailableTab(TabPane.java:794)
      at javafx.scene.control.TabPane$TabPaneSelectionModel.lambda$new$17(TabPane.java:691)
      at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
      at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
      at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
      at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
      at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
      at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
      at javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:155)
      at java.util.AbstractList.add(AbstractList.java:108)
      at javafx.fxml.FXMLLoader$Element.add(FXMLLoader.java:168)
      at javafx.fxml.FXMLLoader$PropertyElement.add(FXMLLoader.java:1403)
      at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:788)
      at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2823)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2532)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
      at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
      at minerocker_batch_ide_2.MineRocker_Batch_IDE_2.start(MineRocker_Batch_IDE_2.java:13)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
      at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
      at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
      at java.lang.Thread.run(Thread.java:745)
  Deleting directory C:\Users\21114693\Documents\NetBeansProjects\MineRocker_Batch_IDE_2\dist\run324064419
  jfxsa-run:
  BUILD SUCCESSFUL (total time: 16 seconds)
  </code></pre>