import java.io.IOException; import java.io.InputStream; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import javafx.animation.FadeTransition; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.fxml.JavaFXBuilderFactory; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.text.Text; import javafx.stage.Stage; import javafx.util.Duration; /** * * @author Mohammed */ public class Printissue extends Application { private Stage stage; private final Stage subStage = new Stage(); private Scene scene; private Parent page; private Parent subParent; private Parent currentPage; @Override public void start(Stage primarystage) throws Exception { this.stage = primarystage; gotoPage1(); primarystage.setFullScreen(false); primarystage.setResizable(false); primarystage.show(); } public static void main(String[] args) { launch(args); } public Stage getStage() { return stage; } public Stage getDialogStage(){ return subStage; } public Parent getPane(){ return page; } public Scene getScene(){ return scene; } public void gotoTable() { } private void gotoLogin() { } private void gotoPage1() { try { Page1Controller page1 = (Page1Controller) replaceSceneContent("page1.fxml"); page1.setApp(this); currentPage = page; } catch (Exception ex) { Logger.getLogger(Printissue.class.getName()).log(Level.SEVERE, null, ex); } } public boolean userLogging(String s1 , String s2) throws SQLException, ClassNotFoundException, IOException { return false; } public boolean userLogout() { currentPage = page; gotoLogin(); return true; } public void pageSubject(Text t) { } private Initializable replaceSceneContent(String fxml) throws Exception { FXMLLoader loader = new FXMLLoader(); InputStream in = Printissue.class.getResourceAsStream(fxml); loader.setBuilderFactory(new JavaFXBuilderFactory()); loader.setLocation(Printissue.class.getResource(fxml)); try { page = (Parent) loader.load(in); } finally { in.close(); } FadeTransition t2 = new FadeTransition(new Duration(2000.0), currentPage); t2.setFromValue(1); t2.setToValue(0); t2.play(); FadeTransition t = new FadeTransition(new Duration(2000.0), page); t.setFromValue(0); t.setToValue(1); t.play(); scene = new Scene(page); stage.setScene(scene); stage.sizeToScene(); return (Initializable) loader.getController(); } private Initializable loadReportFXML(String fxml) throws Exception { FXMLLoader loader = new FXMLLoader(); InputStream in = Printissue.class.getResourceAsStream(fxml); loader.setBuilderFactory(new JavaFXBuilderFactory()); loader.setLocation(Printissue.class.getResource(fxml)); try { subParent = (Parent) loader.load(in); } finally { in.close(); } FadeTransition t = new FadeTransition(new Duration(2000.0), subParent); t.setFromValue(0); t.setToValue(1); t.play(); Scene scene = new Scene(subParent); subStage.setScene(scene); subStage.sizeToScene(); subStage.show(); return (Initializable) loader.getController(); } private void gotoDBError() { } public void gotoDialog(String errDialog){ } }