After launching the application, and when you click the "Look Raspisanie" button, an error crashes:

Can not set javafx.scene.control.TableView field ch.makery.address.view.RaspisaniePrepodOwerview.raspisanieTable to javafx.scene.layout.AnchorPane 

Please help me fix it! Program Code:

 package ch.makery.address.view; import javafx.fxml.FXML; import javafx.scene.control.Label; public class RaspisanieStudentOwerview { @FXML private Label labelTitle; @FXML private Label time1; @FXML private Label time2; @FXML private Label time3; @FXML private Label time4; @FXML private Label time5; @FXML private Label time6; @FXML private Label labelnedelya; @FXML private Label nechet1; @FXML private Label nechet2; @FXML private Label nechet3; @FXML private Label nechet4; @FXML private Label nechet5; @FXML private Label nechet6; @FXML private Label chet1; @FXML private Label chet2; @FXML private Label chet3; @FXML private Label chet4; @FXML private Label chet5; @FXML private Label chet6; @FXML private Label ponedelnik; @FXML private Label vtornik; @FXML private Label sreda; @FXML private Label chhetverg; @FXML private Label pyatnica; @FXML private Label subbota; @FXML private Label arhis1; @FXML private Label arhis2; @FXML private Label arhis3; @FXML private Label arhis4; @FXML private Label arhis5; @FXML private Label arhis6; @FXML private Label trs1; @FXML private Label trs2; @FXML private Label trs3; @FXML private Label trs4; @FXML private Label trs5; @FXML private Label tspp; /** * The constructor. * The constructor is called before the initialize() method. */ public RaspisanieStudentOwerview(){} } 

Fxml file:

 <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.control.*?> <?import java.lang.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.layout.AnchorPane?> <AnchorPane prefHeight="350.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.makery.address.view.RaspisanieStudentOwerview"> <children> <GridPane layoutX="14.0" layoutY="61.0" prefHeight="240.0" prefWidth="48.0"> <columnConstraints> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> </columnConstraints> <rowConstraints> <RowConstraints maxHeight="60.0" minHeight="0.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints maxHeight="60.0" minHeight="0.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> </rowConstraints> <children> <Label fx:id="time1" prefHeight="17.0" prefWidth="42.0" text=" 08:30" /> <Label fx:id="time2" layoutX="10.0" layoutY="19.0" prefHeight="17.0" prefWidth="42.0" text=" 10:10" GridPane.rowIndex="1" /> <Label fx:id="time3" layoutX="10.0" layoutY="54.0" prefHeight="17.0" prefWidth="42.0" text=" 11:50" GridPane.rowIndex="2" /> <Label fx:id="time4" layoutX="10.0" layoutY="89.0" prefHeight="17.0" prefWidth="42.0" text=" 14:00" GridPane.rowIndex="3" /> <Label fx:id="time5" layoutX="10.0" layoutY="124.0" prefHeight="17.0" prefWidth="42.0" text=" 15:40" GridPane.rowIndex="4" /> <Label fx:id="time6" layoutX="10.0" layoutY="159.0" prefHeight="17.0" prefWidth="42.0" text=" 17:20" GridPane.rowIndex="5" /> </children> </GridPane> <GridPane layoutX="65.0" layoutY="41.0" prefHeight="261.0" prefWidth="595.0"> <columnConstraints> <ColumnConstraints hgrow="SOMETIMES" maxWidth="65.0" minWidth="10.0" prefWidth="62.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="82.0" minWidth="10.0" prefWidth="81.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="86.0" minWidth="10.0" prefWidth="86.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="98.0" minWidth="10.0" prefWidth="84.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="93.0" minWidth="10.0" prefWidth="92.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="94.0" minWidth="10.0" prefWidth="92.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="94.0" minWidth="10.0" prefWidth="76.0" /> </columnConstraints> <rowConstraints> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> </rowConstraints> <children> <Label fx:id="arhis1" text="Arhis " GridPane.columnIndex="1" GridPane.rowIndex="1" /> <Label fx:id="nechet1" text="nechet" GridPane.rowIndex="1" /> <Label fx:id="chet1" text="chet" GridPane.rowIndex="2" /> <Label fx:id="chet2" layoutX="10.0" layoutY="33.0" text="chet" GridPane.rowIndex="4" /> <Label fx:id="chet3" layoutX="10.0" layoutY="75.0" text="chet" GridPane.rowIndex="6" /> <Label fx:id="chet4" layoutX="10.0" layoutY="118.0" text="chet" GridPane.rowIndex="8" /> <Label fx:id="chet5" layoutX="10.0" layoutY="147.0" text="chet" GridPane.rowIndex="10" /> <Label fx:id="chet6" layoutX="10.0" layoutY="180.0" text="chet" GridPane.rowIndex="12" /> <Label fx:id="nechet2" layoutX="10.0" layoutY="11.0" text="nechet" GridPane.rowIndex="3" /> <Label fx:id="nechet3" layoutX="10.0" layoutY="11.0" text="nechet" GridPane.rowIndex="5" /> <Label fx:id="nechet4" layoutX="10.0" layoutY="11.0" text="nechet" GridPane.rowIndex="7" /> <Label fx:id="nechet5" layoutX="10.0" layoutY="11.0" text="nechet" GridPane.rowIndex="9" /> <Label fx:id="nechet6" layoutX="10.0" layoutY="11.0" text="nechet" GridPane.rowIndex="11" /> <Label fx:id="arhis2" layoutX="67.0" layoutY="12.0" text="Arhis " GridPane.columnIndex="1" GridPane.rowIndex="2" /> <Label fx:id="arhis3" layoutX="75.0" layoutY="32.0" text="Arhis " GridPane.columnIndex="1" GridPane.rowIndex="7" /> <Label fx:id="arhis4" layoutX="75.0" layoutY="153.0" text="Arhis " GridPane.columnIndex="1" GridPane.rowIndex="8" /> <Label fx:id="arhis5" layoutX="75.0" layoutY="174.0" text="Arhis " GridPane.columnIndex="1" GridPane.rowIndex="9" /> <Label fx:id="arhis6" layoutX="75.0" layoutY="174.0" text="Arhis " GridPane.columnIndex="1" GridPane.rowIndex="10" /> <Label fx:id="trs1" layoutX="75.0" layoutY="112.0" text="TRSiPV " GridPane.columnIndex="2" GridPane.rowIndex="5" /> <Label fx:id="trs2" text="TRSiPV " GridPane.columnIndex="2" GridPane.rowIndex="6" /> <Label fx:id="trs3" text="TRSiPV " GridPane.columnIndex="3" GridPane.rowIndex="4" /> <Label fx:id="labelnedelya" layoutX="10.0" layoutY="32.0" text="nendelya" /> <Label fx:id="ponedelnik" text="Ponedelnik" GridPane.columnIndex="1" /> <Label fx:id="vtornik" text="Vtornik" GridPane.columnIndex="2" /> <Label fx:id="sreda" text="Sreda" GridPane.columnIndex="3" /> <Label fx:id="chhetverg" text="Chetverg" GridPane.columnIndex="4" /> <Label fx:id="pyatnica" text="Pyatinca" GridPane.columnIndex="5" /> <Label fx:id="subbota" text="Subbota" GridPane.columnIndex="6" /> <Label fx:id="trs4" text="TRSiPV " GridPane.columnIndex="6" GridPane.rowIndex="5" /> <Label fx:id="trs5" text="TSPP" GridPane.columnIndex="6" GridPane.rowIndex="4" /> <Label fx:id="tspp" layoutX="335.0" layoutY="152.0" text="TRSiPV" GridPane.columnIndex="5" GridPane.rowIndex="2" /> </children> </GridPane> <Label fx:id="labelTitle" layoutX="273.0" layoutY="14.0" scaleX="2.0" scaleY="2.0" text="Rasspisanie Zanyatiu" /> </children> </AnchorPane> 

StudentRootController file:

 package ch.makery.address.view; import javafx.beans.property.SimpleStringProperty; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import ch.makery.address.StudentMainApp; public class StudentRootController { StudentMainApp studentmainapp = new StudentMainApp(); /** * Opens the Ghurnal Ocenok. */ public void handleGhurnalOcenokShow(){ studentmainapp.showCurrentOcenkiStudent(); } /** * Open Create Lections. */ public void handleShowLectionsShow(){ studentmainapp.ShowLectionsController(); } /** * Open Look Raspisanie. */ public void handleShowRaspisanieShow(){ studentmainapp.ShowRaspisanieController(); } public void FileClose(){ System.exit(0); } } 

STudentOwerWiew Controller file:

 package ch.makery.address.view; import java.io.File; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.util.Scanner; import javax.swing.JFileChooser; import ch.makery.address.MainApp; import ch.makery.address.StudentMainApp; import ch.makery.address.model.Test; import javafx.beans.property.SimpleStringProperty; import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextArea; import javafx.scene.control.cell.TextFieldTableCell; import java.awt.event.ActionEvent; public class StudentOverviewController { @FXML public TextArea taTestStud; @FXML public Label labelTest; @FXML private Button butExportTest;//save @FXML private Button butImportTest;//look /** * The constructor. * The constructor is called before the initialize() method. */ public StudentOverviewController() { } public void FileOpen(){ JFileChooser fileopen = new JFileChooser(); fileopen.setCurrentDirectory(new File(".")); int ret = fileopen.showDialog(null, "Открыть файл"); if (ret == JFileChooser.APPROVE_OPTION) { File file = fileopen.getSelectedFile(); try { FileRead(file.getAbsolutePath()); } catch (Exception e1) { e1.printStackTrace(System.err); } } } public void FileSave(){ JFileChooser fileopen = new JFileChooser(); fileopen.setCurrentDirectory(new File(".")); int ret = fileopen.showDialog(null, "Сохранить в файл"); if (ret == JFileChooser.APPROVE_OPTION) { File file = fileopen.getSelectedFile(); try { FileWrite(file.getAbsolutePath()); } catch (IOException e1) { } } } public void FileWrite(String Filename)throws IOException{ FileWriter f = new FileWriter(Filename); for(Test tst : StudentMainApp.getTestList()){ f.write(tst.TestList.getValue() + "\r\n"); } f.close(); } public void FileRead(String Filename) throws FileNotFoundException, IOException{ StudentMainApp.getTestList().clear(); Scanner fin = new Scanner(new File(Filename)); String test = ""; while(fin.hasNextLine()) { if(StudentMainApp.getTestList().size()>0){ test += fin.nextLine() + "\r\n"; } StudentMainApp.getTestList().add(new Test( new SimpleStringProperty(test) )); } fin.close(); taTestStud.setPromptText(test); } } 

StudentMain APP file:

 package ch.makery.address; import java.io.IOException; import ch.makery.address.model.GhurnalOcenok; import ch.makery.address.model.Lections; import ch.makery.address.model.Test; //import ch.makery.address.view.TestController; import javafx.application.Application; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.BorderPane; import javafx.stage.Modality; //import javafx.stage.Modality; import javafx.stage.Stage; public class StudentMainApp extends Application { private Stage studentStage; private BorderPane rootLayout; //коллекция private static ObservableList<GhurnalOcenok> ghurnalocenokData = FXCollections.observableArrayList(); private static ObservableList<Test> testData = FXCollections.observableArrayList(); private static ObservableList<Lections> lekciiData = FXCollections.observableArrayList(); public static ObservableList<GhurnalOcenok> getGhurnalOcenokList() { return ghurnalocenokData; } public static ObservableList<Test> getTestList() { return testData; } public static ObservableList<Lections> getLectionList() { return lekciiData ; } public StudentMainApp() { // Add some sample data //table } @Override public void start(Stage studentStage ) { this.studentStage = studentStage; this.studentStage.setTitle("TCPP:Student"); initRootLayout(); showTestOverview(); } /** * Initializes the root layout. */ public void initRootLayout() { try { // Load root layout from fxml file. FXMLLoader loader = new FXMLLoader(); loader.setLocation(MainApp.class.getResource("view/StudentLayout.fxml")); rootLayout = (BorderPane) loader.load(); // Show the scene containing the root layout. Scene scene = new Scene(rootLayout); studentStage.setScene(scene); studentStage.show(); } catch (IOException e) { e.printStackTrace(); } } /** * Shows the person overview inside the root layout. */ public void showTestOverview() { try { // Load person overview. FXMLLoader loader = new FXMLLoader(); loader.setLocation(MainApp.class.getResource("view/StudentOverviewController.fxml"));// view/PrepodOverviewController.fxml AnchorPane studentOverview = (AnchorPane)loader.load(); // Set person overview into the center of root layout. rootLayout.setCenter(studentOverview); } catch (IOException e) { e.printStackTrace(); } } /** * Returns the main stage. * @return */ public Stage getPrimaryStage() { return studentStage; } public void ShowLectionsController() { try { // Load the fxml file and create a new stage for the popup. FXMLLoader loader = new FXMLLoader(); loader.setLocation(PrepodMainApp.class.getResource("view/Lekcui.fxml")); AnchorPane page = (AnchorPane)loader.load(); Stage dialogStage = new Stage(); dialogStage.setTitle("Lekcionnuy Material"); dialogStage.initModality(Modality.WINDOW_MODAL); dialogStage.initOwner(studentStage); Scene scene = new Scene(page); dialogStage.setScene(scene); // Set the persons into the controller. //TestController controller = loader.getController(); //controller.setOcenkiData( ghurnalocenokData); dialogStage.show(); } catch (IOException e) { e.printStackTrace(); } } public void ShowRaspisanieController() { try { // Load the fxml file and create a new stage for the popup. FXMLLoader loader = new FXMLLoader(); loader.setLocation(PrepodMainApp.class.getResource("view/Raspisaniye.fxml")); AnchorPane page = (AnchorPane)loader.load(); Stage dialogStage = new Stage(); dialogStage.setTitle("Raspisanie_Prepoda"); dialogStage.initModality(Modality.WINDOW_MODAL); dialogStage.initOwner(studentStage); Scene scene = new Scene(page); dialogStage.setScene(scene); dialogStage.show(); } catch (IOException e) { e.printStackTrace(); } } public void showCurrentOcenkiStudent() { try { // Load the fxml file and create a new stage for the popup. FXMLLoader loader = new FXMLLoader(); loader.setLocation(MainApp.class.getResource("view/Current Ocenki Studenta.fxml"));// AnchorPane page = (AnchorPane)loader.load(); Stage dialogStage = new Stage(); dialogStage.setTitle("Current Ocenki for all learning year"); dialogStage.initModality(Modality.WINDOW_MODAL); dialogStage.initOwner(studentStage); Scene scene = new Scene(page); dialogStage.setScene(scene); // Set the persons into the controller. //BarChartStatisticController controller = loader.getController(); //controller.setOcenkiData( ghurnalocenokData); dialogStage.show(); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) { launch(args); } } 

    0