title: No injectable field found in FXML Controller class
body: <p>It's about JavaFX. When i want to inject fx:id in Scene Builder, i get this warning: <br />No injectable field found in FXML Controller class for the id 'something'. <br />I wanted to ignore it, and created a function, but it didn't work either. I created mainController class and added it into my FXML file. Here are my codes...<br />
  <br />mainController.java</p>
  
  <pre><code>package main;
  
  import java.net.URL;
  import java.util.ResourceBundle;
  import javafx.event.ActionEvent;
  import javafx.fxml.FXML;
  import javafx.fxml.Initializable;
  import javafx.scene.control.Label;
  import javafx.scene.control.ProgressBar;
  import javafx.scene.control.Slider;
  
  public class mainController implements Initializable {
  
      @Override
      public void initialize(URL arg0, ResourceBundle arg1) {
          // TODO Auto-generated method stub
      }
  
      @FXML
      private ProgressBar pb;
      @FXML
      private Slider sl;
          @FXML
          private Label label;
  
      public void changed(ActionEvent event){
  
          }
  }
  </code></pre>
  
  <p><br />Main.java</p>
  
  <pre><code>package main;
  
  import javafx.application.Application;
  import javafx.event.ActionEvent;
  import javafx.event.EventHandler;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.scene.control.Button;
  import javafx.scene.control.ProgressBar;
  import javafx.scene.layout.StackPane;
  import javafx.stage.Stage;
  
  public class Main extends Application {
  
      @Override
      public void start(Stage primaryStage) throws Exception{
          Parent root = FXMLLoader.load(getClass().getResource("/fxml/main.fxml"));
          Scene scene = new Scene(root, 600, 400);
          scene.getStylesheets().add("/fxml/styles/main.css");
  
          ProgressBar pb1 = new ProgressBar();
          ProgressBar pb2 = new ProgressBar();
  
          //pb1.
  
          //primaryStage.setResizable(false);
          primaryStage.setScene(scene);
          primaryStage.setTitle("Something");
          primaryStage.show();
      }
  
      /**
       * @param args the command line arguments
       */
      public static void main(String[] args) {
          launch(args);
      }
  
  }
  </code></pre>
  
  <p><br />main.fxml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import javafx.geometry.*?&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;AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:controller="main.mainController"&gt;
     &lt;children&gt;
        &lt;BorderPane layoutX="14.0" layoutY="14.0" prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"&gt;
           &lt;top&gt;
              &lt;ProgressBar fx:id="pb" prefWidth="200.0" progress="0.0" BorderPane.alignment="CENTER"&gt;
                 &lt;BorderPane.margin&gt;
                    &lt;Insets bottom="30.0" left="30.0" right="30.0" top="30.0" /&gt;
                 &lt;/BorderPane.margin&gt;
              &lt;/ProgressBar&gt;
           &lt;/top&gt;
           &lt;bottom&gt;
              &lt;Slider fx:id="sl" onDragDetected="#changed" BorderPane.alignment="CENTER"&gt;
                 &lt;BorderPane.margin&gt;
                    &lt;Insets bottom="30.0" left="30.0" right="30.0" top="30.0" /&gt;
                 &lt;/BorderPane.margin&gt;
              &lt;/Slider&gt;
           &lt;/bottom&gt;
        &lt;/BorderPane&gt;
     &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>
  
  <p>I did same things in my old projects, and they work like a charm. But this one seems not to obey me. Thanks in advance...</p>