List of usage examples for javafx.stage Stage initStyle
public final void initStyle(StageStyle style)
From source file:com.SignalDiagram.FXMLDocumentController.java
@FXML private void showAbout(ActionEvent event) { Stage stage = new Stage(); Parent root;/*from w ww . j a v a2s. c o m*/ try { root = FXMLLoader.load(getClass().getResource("FXMLAbout.fxml")); stage.setScene(new Scene(root)); stage.setTitle("About"); stage.initStyle(StageStyle.UTILITY); stage.initModality(Modality.APPLICATION_MODAL); // stage.initOwner(((Node) event.getSource()).getScene().getWindow()); stage.setResizable(false); stage.show(); } catch (IOException ex) { Logger.getLogger(FXMLDocumentController.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.toyota.carservice.SplashScreen.java
@Override public void start(Stage stage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("/com/toyota/carservice/view/formSplash.fxml")); Scene scene = new Scene(root); stage.setTitle("Connection to database..."); ApplicationContext appContex = config.getInstance().getApplicationContext(); Resource resource = appContex.getResource("classpath:com/toyota/carservice/img/kallatoyota.png"); stage.getIcons().add(new Image(resource.getURI().toString())); stage.setScene(scene);/*from www . jav a 2 s. c o m*/ stage.initStyle(StageStyle.UNDECORATED); stage.show(); }
From source file:ui.ChoseFonctionnalite.java
private void startClientMode(ActionEvent eventT) { //File config = new File("resource/config.json"); String host = ""; String port = "8000"; Stage stageModal = new Stage(); Pane root = new Pane(); root.setBackground(new Background(new BackgroundImage(new Image("resource/background.jpg"), BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.CENTER, new BackgroundSize(530, 400, true, true, true, true)))); stageModal.setScene(new Scene(root, 200, 200)); stageModal.initStyle(StageStyle.UTILITY); Label adresse = new Label("Adresse serveur:"); adresse.setLayoutX(10);/*from www .java 2 s . c o m*/ adresse.setLayoutY(10); adresse.setFont(Font.font("Arial", 16)); JFXTextField adresseInput = new JFXTextField("127.0.0.1"); adresseInput.setPrefWidth(180); adresseInput.setLayoutX(10); adresseInput.setLayoutY(40); JFXButton valider = new JFXButton("Se connecter"); valider.setCursor(Cursor.HAND); valider.setMinSize(100, 30); valider.setLayoutX(20); valider.setLayoutY(130); valider.setFont(new Font(20)); valider.setStyle("-fx-background-color: #9E21FF;"); valider.setOnAction(event -> { if (adresseInput.getText() != "") { stageModal.close(); InitClient initializeClient = new InitClient(stage, adresseInput.getText(), port); } }); root.getChildren().add(valider); root.getChildren().add(adresse); root.getChildren().add(adresseInput); stageModal.setTitle("Adresse serveur"); stageModal.initModality(Modality.WINDOW_MODAL); stageModal.initOwner(((Node) eventT.getSource()).getScene().getWindow()); stageModal.show(); }
From source file:io.bitsquare.app.BitsquareApp.java
private void showFPSWindow() { Label label = new Label(); EventStreams.animationTicks().latestN(100).map(ticks -> { int n = ticks.size() - 1; return n * 1_000_000_000.0 / (ticks.get(n) - ticks.get(0)); }).map(d -> String.format("FPS: %.3f", d)).feedTo(label.textProperty()); Pane root = new StackPane(); root.getChildren().add(label);/*ww w . j ava 2 s . c om*/ Stage stage = new Stage(); stage.setScene(new Scene(root)); stage.setTitle("FPS"); stage.initModality(Modality.NONE); stage.initStyle(StageStyle.UTILITY); stage.initOwner(scene.getWindow()); stage.setX(primaryStage.getX() + primaryStage.getWidth() + 10); stage.setY(primaryStage.getY()); stage.setWidth(200); stage.setHeight(100); stage.show(); }
From source file:io.bitsquare.app.BitsquareApp.java
private void showDebugWindow() { ViewLoader viewLoader = injector.getInstance(ViewLoader.class); View debugView = viewLoader.load(DebugView.class); Parent parent = (Parent) debugView.getRoot(); Stage stage = new Stage(); stage.setScene(new Scene(parent)); stage.setTitle("Debug window"); stage.initModality(Modality.NONE);/*w ww. j a v a 2 s. com*/ stage.initStyle(StageStyle.UTILITY); stage.initOwner(scene.getWindow()); stage.setX(primaryStage.getX() + primaryStage.getWidth() + 10); stage.setY(primaryStage.getY()); stage.show(); }
From source file:ExcelFx.FXMLDocumentController.java
@FXML private void TablePatch(ActionEvent event) throws IOException { System.out.println("ExcelFx.FXMLDocumentController.TablePatch()"); try {/*w w w . j a v a 2 s . com*/ FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("FileOpenFXML.fxml")); Parent root1 = (Parent) fxmlLoader.load(); Stage stage = new Stage(); stage.initModality(Modality.WINDOW_MODAL); stage.initStyle(StageStyle.DECORATED); stage.setTitle(" "); stage.setScene(new Scene(root1)); stage.show(); } catch (Exception e) { System.err.println(e); } }
From source file:ExcelFx.FXMLDocumentController.java
@Override public void initialize(URL url, ResourceBundle rb) { this.Print.setDisable(true); footer.setItems(names);/* ww w . j av a 2 s . c o m*/ JsonWrite jsw = new JsonWrite(); File universityFile = new File("university.json"); File collegeFile = new File("college.json"); //File codesFile = new File("codes.json"); if ((universityFile.exists()) && (collegeFile.exists()) /*&& (codesFile.exists())*/) { try { this.universityJson.jsonRead("university.json"); this.collegeJson.jsonRead("college.json"); //this.codesJson.jsonRead("codes.json"); this.jsonXLSXData.setAll(universityJson, collegeJson/*, codesJson*/); } catch (IOException | ParseException ex) { Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle(""); alert.setHeaderText(" ? ? "); alert.setContentText(ex.toString()); alert.showAndWait(); Logger.getLogger(FXMLDocumentController.class.getName()).log(Level.SEVERE, null, ex); } } else { try { FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("FileOpenFXML.fxml")); this.fileOpenParent = (Parent) fxmlLoader.load(); Stage stage = new Stage(); stage.initModality(Modality.APPLICATION_MODAL); stage.initStyle(StageStyle.DECORATED); stage.setTitle(" "); stage.setScene(new Scene(this.fileOpenParent)); stage.showAndWait(); } catch (Exception e) { System.err.println(e); } this.jsonXLSXData.setAll(universityJson, collegeJson/*, codesJson*/); } }
From source file:com.jf.javafx.Application.java
/** * Start the application/*from w w w. ja v a 2 s .c o m*/ * * @param primaryStage * @throws java.lang.Exception */ @Override public void start(Stage primaryStage) throws Exception { Application.sapp = this; this.pStage = primaryStage; // set env variables _initVars(); // load properties _initConfigurations(); _initStartupServices(); // handle on closing window primaryStage.setOnHidden((WindowEvent event) -> { _commitProperties(); }); primaryStage.initStyle(StageStyle.TRANSPARENT); primaryStage.setTitle(getResourceBundle().getString("app.title")); primaryStage.show(); }
From source file:ExcelFx.FXMLDocumentController.java
@FXML private void Open(ActionEvent event) throws NullPointerException, IOException { System.out.println("-----------------------------------------------------------"); System.out.println("Pressed open Button "); File universityFile = new File("university.json"); File collegeFile = new File("college.json"); System.out.println("University File emty is " + String.valueOf(universityFile.length() == 0)); System.out.println("College File emty is " + String.valueOf(collegeFile.length() == 0)); //File codesFile = new File("codes.json"); if ((universityFile.exists()) && (collegeFile.exists()) /*&& (codesFile.exists())*/) { try {//from ww w .j a v a 2 s. co m this.universityJson.jsonRead("university.json"); this.collegeJson.jsonRead("college.json"); //this.codesJson.jsonRead("codes.json"); this.jsonXLSXData.setAll(universityJson, collegeJson/*, codesJson*/); } catch (IOException | ParseException ex) { Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle(""); alert.setHeaderText(" ? ? "); alert.setContentText(ex.toString()); alert.showAndWait(); Logger.getLogger(FXMLDocumentController.class.getName()).log(Level.SEVERE, null, ex); } } else { try { FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("FileOpenFXML.fxml")); this.fileOpenParent = (Parent) fxmlLoader.load(); Stage stage = new Stage(); stage.initModality(Modality.APPLICATION_MODAL); stage.initStyle(StageStyle.DECORATED); stage.setTitle(" "); stage.setScene(new Scene(this.fileOpenParent)); stage.showAndWait(); } catch (Exception e) { System.err.println(e); } this.jsonXLSXData.setAll(universityJson, collegeJson/*, codesJson*/); } FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("InitalData.fxml")); Parent root1 = (Parent) fxmlLoader.load(); Stage stage = new Stage(); stage.initModality(Modality.APPLICATION_MODAL); stage.initStyle(StageStyle.DECORATED); stage.setTitle(" "); stage.setScene(new Scene(root1)); stage.showAndWait(); setProgressBar(-1.); Task task = new Task<Void>() { @Override protected Void call() throws Exception { initaldata = (JsonWrite) root1.getUserData(); System.out.println("Inital Data empty is " + initaldata.isEmpty()); initaldata.setPage(String.valueOf(Integer.parseInt(initaldata.getPage()) - 1)); Parser parser = new Parser(); list = parser.parseInitalData(initaldata.getPatch(), Integer.parseInt(initaldata.getPage())); //System.out.println(list.size()); Sort sort = new Sort(list, jsonXLSXData, initaldata.getYStart(), initaldata.getYEnd()); HashMap<String, HashMap<String, ArrayList<String>>> hm = sort .professionsGrouping(initaldata.getYStart(), initaldata.getYEnd()); sortProf = sort.addWay(hm); return null; } }; mainProcessing(task); System.out.println("button open finished"); System.out.println("-----------------------------------------------------------"); }
From source file:org.beryx.viewreka.fxapp.ProjectLibs.java
public void installLibs(String prjName, File prjDir) { InstallLibsTask task = new InstallLibsTask(prjName, prjDir, lstLib); Stage progressStage = new Stage(); progressStage.setOnCloseRequest(ev -> { if (Dialogs.confirmYesNo("Cancel", "Are you sure you want to cancel the installation of project libraries?", null)) { task.cancel();// w w w. j a v a2 s . c o m } }); progressStage.initStyle(StageStyle.UTILITY); progressStage.initModality(Modality.APPLICATION_MODAL); progressStage.setTitle("Create project " + prjName); GridPane grid = new GridPane(); grid.setHgap(20); grid.setVgap(20); grid.setPadding(new Insets(24, 10, 0, 24)); ProgressIndicator progressIndicator = new ProgressIndicator(); progressIndicator.setPrefSize(64, 64); progressIndicator.setMinSize(64, 64); progressIndicator.setMaxSize(64, 64); // progressIndicator.progressProperty().bind(task.progressProperty()); grid.add(progressIndicator, 0, 0); Label actionLabel = new Label("Install project libraries..."); actionLabel.textProperty().bind(task.messageProperty()); grid.add(actionLabel, 1, 0); progressStage.setScene(new Scene(grid, 600, 120)); task.setOnSucceeded(ev -> closeProgress(progressStage, task)); task.setOnFailed(ev -> closeProgress(progressStage, task)); task.setOnCancelled(ev -> closeProgress(progressStage, task)); progressStage.setOnShown(ev -> Executors.newSingleThreadExecutor().submit(task)); progressStage.showAndWait(); }