@Override public void start(Stage primaryStage) throws Exception { Platform.setImplicitExit(false); l.countDown(); }
public boolean shutdown() { boolean implicitExit = Platform.isImplicitExit(); Platform.setImplicitExit(false); if (!doShutdown()) { Platform.setImplicitExit(implicitExit); return false; } return true; }
/** * allow startup without launch */ public static void toolkitInit() { if (!toolkitStarted) { toolkitStarted = true; // do not exit on close of last window // https://stackoverflow.com/a/10217157/1497139 Platform.setImplicitExit(false); /// https://stackoverflow.com/a/38883432/1497139 // http://www.programcreek.com/java-api-examples/index.php?api=com.sun.javafx.application.PlatformImpl com.sun.javafx.application.PlatformImpl.startup(() -> { }); } }
public static void main (final @Nonnull String ... args) { try { // FIXME: Mac OS X only final Path logfolder = new File(System.getProperty("user.home") + "/Library/Application Support/Zephyr/logs").toPath(); System.err.println("Logging folder: " + logfolder); Files.createDirectories(logfolder); System.setProperty("it.tidalwave.northernwind.rca.logFolder", logfolder.toAbsolutePath().toString()); Platform.setImplicitExit(true); launch(args); } catch (Throwable t) { // Don't use logging facilities here, they could be not initialized t.printStackTrace(); System.exit(-1); } }
public NewWorkerView(PresentationModel model) { Validate.notNull(model); setLayout(new BorderLayout()); fxPanel = new JFXPanel(); //Scene dimensions not used by Dialog as it is created later, set on fxPanel as well: fxPanel.setPreferredSize(new Dimension(SCENE_WIDTH, SCENE_HEIGHT)); Platform.setImplicitExit(false); // create JavaFX scene Platform.runLater(new SceneInitializer(model)); add(fxPanel, BorderLayout.CENTER); }
private void initComponents() { setLayout(new BorderLayout()); fxPanel = new JFXPanel(); //Scene dimensions not used by Dialog as it is created later, set on fxPanel as well: fxPanel.setPreferredSize(new Dimension(SCENE_WIDTH, SCENE_HEIGHT)); Platform.setImplicitExit(false); // create JavaFX scene Platform.runLater(new Runnable() { @Override public void run() { final Scene scene = new Scene(new Browser(rootCallback), 750, 500, Color.web("#666970")); fxPanel.setScene(scene); } }); add(fxPanel, BorderLayout.CENTER); }
private void initComponents(final CrudPane.Factory factory) { setLayout(new BorderLayout()); fxPanel = new JFXPanel(); //Scene dimensions not used by Dialog as it is created later, set on fxPanel as well: fxPanel.setPreferredSize(new Dimension(SCENE_WIDTH, SCENE_HEIGHT)); Platform.setImplicitExit(false); Platform.runLater(new Runnable() { @Override public void run() { CrudPane root = factory.create(model); Scene scene = new Scene(root, SCENE_WIDTH, SCENE_HEIGHT); StyleManager.Default.applyFormStyle(scene); fxPanel.setScene(scene); } }); add(fxPanel, BorderLayout.CENTER); }
private void initComponents() { setLayout(new BorderLayout()); fxPanel = new JFXPanel(); //Scene dimensions not used by Dialog as it is created later, set on fxPanel as well: fxPanel.setPreferredSize(new Dimension(SCENE_WIDTH, SCENE_HEIGHT)); Platform.setImplicitExit(false); // create JavaFX scene Platform.runLater(new Runnable() { @Override public void run() { try { FXMLLoader loader = new FXMLLoader(getClass().getResource("Login.fxml")); loader.setController(controller); Parent root = (Parent) loader.load(); Scene scene = new Scene(root); fxPanel.setScene(scene); } catch (IOException ex) { Exceptions.printStackTrace(ex); } } }); add(fxPanel, BorderLayout.CENTER); }
Platform.setImplicitExit(false);
Platform.setImplicitExit(false);
fxPanel = new JFXPanel(); Platform.setImplicitExit(false);
Platform.setImplicitExit(false);
@Override public void run() { if (v == null) { Platform.setImplicitExit(false); try {
stage = new Stage(); Platform.setImplicitExit(false); WebView view = new WebView(); view.setCache(false);
Platform.setImplicitExit(false);
private void createScene(final String htmlContent) { Platform.setImplicitExit(false); Platform.runLater(() -> { WebView view = new WebView(); engine = view.getEngine(); engine.setOnStatusChanged(event -> SwingUtilities.invokeLater(() -> lblStatus.setText(event.getData()))); engine.getLoadWorker().workDoneProperty() .addListener((ChangeListener<Number>) (observableValue, oldValue, newValue) -> SwingUtilities .invokeLater(() -> progressBar.setValue(newValue.intValue()))); engine.getLoadWorker().exceptionProperty() .addListener((ObservableValue<? extends Throwable> o, Throwable old, final Throwable value) -> { if (engine.getLoadWorker().getState() == State.FAILED) { SwingUtilities.invokeLater(() -> JOptionPane .showMessageDialog( resultsScrollPane, (value != null) ? engine .getLocation() + "\n" + value.getMessage() : engine.getLocation() + "\nUnexpected error.", "Loading error...", JOptionPane.ERROR_MESSAGE)); } }); jfxPanel.setScene(new Scene(view)); }); }
Platform.setImplicitExit( false );
/** * Method that initializes the scene by loading all needed .fxml files and * sets the primary stage. * * @throws IOException * in case of bugs */ @Override public void start(final Stage primaryStage) throws IOException { Thread.setDefaultUncaughtExceptionHandler(FXUtil::errorAlert); this.primaryStage = primaryStage; this.primaryStage.setTitle("Alchemist"); initLayout("RootLayout"); initLayout("LeftLayout"); initLayout("CenterLayout"); initLayout("TopLayout"); Platform.setImplicitExit(false); this.primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() { @Override public void handle(final WindowEvent wind) { wind.consume(); controllerCenter.checkChanges(); if (controllerCenter.isCorrectnessSpinTime() && controllerCenter.isCorrectnessSpinOut()) { controllerTop.terminateWatcher(); Platform.exit(); } } }); }
@Override public void start( Stage primaryStage ) { Platform.setImplicitExit( false );
/** * This method is called by {@link FxUiManager} and is the first call that is made after {@link * FxUiManager#startGui(Stage)} is called. * <p> * Here we mostly do some post-processing to: * <ul> * <li>Disable closure of the application on closure of main stage</li> * <li>Treating closure of main stage as a request to hide it</li> * <li>Set-up minimum stage size constraints</li> * <li>Register it again {@link StageManager} for retrieval in various places</li> * </ul> * * @param mainStage The application's main stage. */ @Override protected void onStageCreated(final Stage mainStage) { Platform.setImplicitExit(false); mainStage.setOnCloseRequest(e -> handleMainStageClosure(mainStage)); mainStage.setMinHeight(environment.getRequiredProperty("mainStage.minHeight", Integer.class)); mainStage.setMinWidth(environment.getRequiredProperty("mainStage.minWidth", Integer.class)); mainStage.setWidth(600.0); mainStage.setHeight(500.0); stageManager.registerSingle(Screen.ROOT_VIEW, mainStage); }