import javafx.application.Application; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.stage.Stage; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Label; public class App extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("app.fxml")); Scene scene1 = new Scene(root, 300, 250); primaryStage.setScene(scene1); primaryStage.show(); } @FXML private Label celfelirat; @FXML protected void onClickMehetGomb(ActionEvent event) { celfelirat.setText("Működik"); } }