@Override public void start(Stage stage) { Pane root = new Pane(); for(int i = 0 ;i < 4000; i++) { Label child = new Label("label" + i); child.setLayoutX(Math.random() * 500 + 100); child.setLayoutY(Math.random() * 500+ 100); root.getChildren().add(child); } root.getChildren().add(build()); FPSDecorator decorator = new FPSDecorator(stage, root); final Scene scene = new Scene(decorator, 800, 800); stage.setScene(scene); stage.setResizable(true); stage.show(); afterShow(stage); }
@Override public void start(Stage stage) { FlowPane main = new FlowPane(); main.setVgap(20); main.setHgap(20); CheckBox cb = new CheckBox("CheckBox"); JFXCheckBox jfxCheckBox = new JFXCheckBox("JFX CheckBox"); JFXCheckBox customJFXCheckBox = new JFXCheckBox("Custom JFX CheckBox"); customJFXCheckBox.getStyleClass().add("custom-jfx-check-box"); main.getChildren().add(cb); main.getChildren().add(jfxCheckBox); main.getChildren().add(customJFXCheckBox); StackPane pane = new StackPane(); pane.getChildren().add(main); StackPane.setMargin(main, new Insets(100)); pane.setStyle("-fx-background-color:WHITE"); final Scene scene = new Scene(pane, 600, 200); scene.getStylesheets().add(CheckBoxDemo.class.getResource("/css/jfoenix-components.css").toExternalForm()); stage.setTitle("JFX CheckBox Demo "); stage.setScene(scene); stage.setResizable(false); stage.show(); }
@Override public void start(Stage primaryStage) throws Exception { JFXComboBox<Label> combo = new JFXComboBox<>(); combo.getItems().add(new Label("Java 1.8")); combo.getItems().add(new Label("Java 1.7")); combo.getItems().add(new Label("Java 1.6")); combo.getItems().add(new Label("Java 1.5")); combo.setEditable(true); combo.setPromptText("Select Java Version"); combo.setConverter(new StringConverter<Label>() { @Override public String toString(Label object) { return object==null? "" : object.getText(); } @Override public Label fromString(String string) { return new Label(string); } }); HBox pane = new HBox(100); HBox.setMargin(combo, new Insets(20)); pane.setStyle("-fx-background-color:WHITE"); pane.getChildren().add(combo); final Scene scene = new Scene(pane, 300, 300); scene.getStylesheets().add(ComboBoxDemo.class.getResource("/css/jfoenix-components.css").toExternalForm()); primaryStage.setTitle("JFX ComboBox Demo"); primaryStage.setScene(scene); primaryStage.setResizable(false); primaryStage.show(); }
@Override public void start(Stage primaryStage) throws Exception { JFXHamburger show = new JFXHamburger(); show.setPadding(new Insets(10, 5, 10, 5)); JFXRippler rippler = new JFXRippler(show, RipplerMask.CIRCLE, RipplerPos.BACK); JFXListView<Label> list = new JFXListView<>(); for (int i = 1; i < 5; i++) { list.getItems().add(new Label("Item " + i)); } AnchorPane container = new AnchorPane(); container.getChildren().add(rippler); AnchorPane.setLeftAnchor(rippler, 200.0); AnchorPane.setTopAnchor(rippler, 210.0); StackPane main = new StackPane(); main.getChildren().add(container); JFXPopup popup = new JFXPopup(list); rippler.setOnMouseClicked(e -> popup.show(rippler, PopupVPosition.TOP, PopupHPosition.LEFT)); final Scene scene = new Scene(main, 800, 800); scene.getStylesheets().add(PopupDemo.class.getResource("/css/jfoenix-components.css").toExternalForm()); primaryStage.setTitle("JFX Popup Demo"); primaryStage.setScene(scene); primaryStage.setResizable(false); primaryStage.show(); }
@Override public void start(Stage stage) throws Exception { final VBox pane = new VBox(); pane.setSpacing(30); pane.setStyle("-fx-background-color:#EEE; -fx-padding: 40;"); ToggleButton button = new ToggleButton("JavaFx Toggle"); pane.getChildren().add(button); JFXToggleButton toggleButton = new JFXToggleButton(); toggleButton.setText("New Skin"); pane.getChildren().add(toggleButton); JFXToggleNode node = new JFXToggleNode(); final GlyphIcon heartIcon = GlyphsBuilder.create(FontAwesomeIconView.class) .glyph(FontAwesomeIcon.HEART) .build(); heartIcon.setStyle("-fx-padding: 10"); node.setGraphic(heartIcon); pane.getChildren().add(node); final Scene scene = new Scene(pane, 600, 400, Color.valueOf("#EEE")); stage.setTitle("JFX Toggle Button Demo "); scene.getStylesheets() .add(ToggleButtonDemo.class.getResource("/css/jfoenix-components.css").toExternalForm()); stage.setScene(scene); stage.setResizable(false); stage.show(); }
scene.getStylesheets().add(ListViewDemo.class.getResource("/css/jfoenix-components.css").toExternalForm()); stage.setScene(scene); stage.setResizable(false); stage.show();
stage.setTitle("JFX TextField Demo "); stage.setScene(scene); stage.setResizable(false); stage.show();
stage.setTitle("JFX Burgers Demo :) "); stage.setScene(scene); stage.setResizable(false);
stage.setResizable(true); stage.show();
stage.setResizable(false); stage.show();
stage.setTitle("JFX ProgressBar Demo "); stage.setScene(scene); stage.setResizable(false); stage.show();
dialog.setResizable(false);
import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.*; import javafx.stage.*; public class StageTrackingSample extends Application { @Override public void start(final Stage stage) throws Exception { final FXMLLoader loader = new FXMLLoader( getClass().getResource( "stagetracking.fxml" ) ); final Parent root = (Parent) loader.load(); final StageTrackingController controller = loader.getController(); controller.initData(stage); stage.initStyle(StageStyle.UTILITY); stage.setResizable(false); stage.setScene(new Scene(root)); stage.show(); } public static void main(String[] args) { launch(args); } }
Scene scene = new Scene(root, 400, 400); primaryStage.setScene(scene); primaryStage.setResizable(false); StackPane waitingPane = new StackPane(); final ProgressBar progress = new ProgressBar();
/** Set true if we want to resize things (default is not resizable) */ public void setResizable(boolean resizable) { // PApplicationFX.resizable = resizable; // if (stage != null) { stage.setResizable(resizable); // } }
@Override public void start(Stage stage) throws Exception{ FXMLLoader loader = new FXMLLoader(getClass().getResource("MainWindow.fxml")); Parent root = loader.load(); Scene scene = new Scene(root, 600, 575); stage.setScene(scene); stage.setTitle("Test"); stage.setResizable(false); stage.show(); System.out.println(scene.lookup("#vBox")); }
private void updateWindow() { if (this.w != null) { this.w.setMaximized(this.maximizable); // this.w.setMinizable(); this.w.setResizable(this.resizable); this.w.setTitle(this.title); } }
private void updateWindow() { if (this.w != null) { this.w.setMaximized(this.maximizable); // this.w.setMinizable(); this.w.setResizable(this.resizable); this.w.setTitle(this.title); } }
primaryStage.close(); Stage stage = new Stage(); root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml")); scene = new Scene(root); stage.setScene(scene); stage.sizeToScene(); stage.setResizable(false); stage.show();
Stage stage = new Stage(); stage.setTitle("Title"); stage.setResizable(false); stage.initModality(Modality.APPLICATION_MODAL); stage.initOwner(primaryStage); stage.initStyle(StageStyle.UTILITY); (...) Scene scene = new Scene(...); stage.setScene(scene);