Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

IntelliJ and SceneBuilder code sync

$
0
0

        Hi everyone.

 

I am new to Java and IntelliJ. I'm testing forms with JavaFX and SceneBuilder.
I created a "test form", it show all right.

 

My question is, when I drop a new control in SceneBuilder, affect it a "name" (fx:id),

why doesn't my controller code it IntelliJ doesn't gets updated ? (the controller.java class)

 

I'm trying to add a simple checkbox.

 

here is the code of my controller class :

package sample :

 

import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.input.MouseEvent;

 


public class Controller {

 

    @FXML
    private ResourceBundle resources;

 

    @FXML
    private URL location;

 

    @FXML
    private Button MyButton;

 

    @FXML
    private TextArea MyText;

 


    @FXML
    void MyButtonClick(MouseEvent event)
    {
        MyText.appendText("coucou \n");
    }

 

    @FXML
    void initialize() {
        assert MyButton != null : "fx:id=\"MyButton\" was not injected: check your FXML file 'sample.fxml'.";
        assert MyText != null : "fx:id=\"MyText\" was not injected: check your FXML file 'sample.fxml'.";

 


    }

 

}

 

Eric Walker


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>