Buonasera,
Stavo scrivendo del codice quando mi sono imbattuto in questo errore e non sto capendo cosa sto sbagliando..
Mi segna l'errore sul metodo "showOverviewLayout" e dice questo "void is an invalid type for the variable showOverviewLayout".
Mi sta facendo diventare scemo..
Mi dareste una mano a capire? Grazie.
Stavo scrivendo del codice quando mi sono imbattuto in questo errore e non sto capendo cosa sto sbagliando..
Mi segna l'errore sul metodo "showOverviewLayout" e dice questo "void is an invalid type for the variable showOverviewLayout".
Mi sta facendo diventare scemo..
Java:
package core;
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public class MainApp extends Application {
private Stage primaryStage;
private BorderPane rootLayout;
@Override
public void start(Stage primaryStage) {
this.primaryStage = primaryStage;
this.primaryStage.setTitle("InfoOS");
initRootLayout();
showOverviewLayout();
}
public static void main(String[] args) {
launch(args);
}
// initialize the root layout
public void initRootLayout() {
try {
//load
FXMLLoader loader = new FXMLLoader();
loader.setLocation(MainApp.class.getResource("gui/RootLayout.fxml"));
rootLayout = (BorderPane) loader.load();
// Show the scene containing the root layout
Scene scene = new Scene(rootLayout);
primaryStage.setScene(scene);
primaryStage.show();
} catch (IOException e) {
e.printStackTrace();
}
}
public void showOverviewLayout {
try {
//load
FXMLLoader loader = new FXMLLoader();
loader.setLocation(MainApp.class.getResource("gui/OverviewLayout.fxml"));
AnchorPane overview = (AnchorPane) loader.load();
//Set the table into the center of root layout
rootLayout.setCenter(overview);
}catch (IOException e) {
e.printStackTrace();
}
}
}