javafx.scene.layout.VBoxBuilder Java Examples
The following examples show how to use
javafx.scene.layout.VBoxBuilder.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ColorPickerSample.java From marathonv5 with Apache License 2.0 | 6 votes |
public ColorPickerSample() { final ColorPicker colorPicker = new ColorPicker(Color.GRAY); ToolBar standardToolbar = ToolBarBuilder.create().items(colorPicker).build(); final Text coloredText = new Text("Colors"); Font font = new Font(53); coloredText.setFont(font); final Button coloredButton = new Button("Colored Control"); Color c = colorPicker.getValue(); coloredText.setFill(c); coloredButton.setStyle(createRGBString(c)); colorPicker.setOnAction(new EventHandler() { public void handle(Event t) { Color newColor = colorPicker.getValue(); coloredText.setFill(newColor); coloredButton.setStyle(createRGBString(newColor)); } }); VBox coloredObjectsVBox = VBoxBuilder.create().alignment(Pos.CENTER).spacing(20).children(coloredText, coloredButton).build(); VBox outerVBox = VBoxBuilder.create().alignment(Pos.CENTER).spacing(150).padding(new Insets(0, 0, 120, 0)).children(standardToolbar, coloredObjectsVBox).build(); getChildren().add(outerVBox); }
Example #2
Source File: ColorPickerSample.java From marathonv5 with Apache License 2.0 | 6 votes |
public ColorPickerSample() { final ColorPicker colorPicker = new ColorPicker(Color.GRAY); ToolBar standardToolbar = ToolBarBuilder.create().items(colorPicker).build(); final Text coloredText = new Text("Colors"); Font font = new Font(53); coloredText.setFont(font); final Button coloredButton = new Button("Colored Control"); Color c = colorPicker.getValue(); coloredText.setFill(c); coloredButton.setStyle(createRGBString(c)); colorPicker.setOnAction(new EventHandler() { public void handle(Event t) { Color newColor = colorPicker.getValue(); coloredText.setFill(newColor); coloredButton.setStyle(createRGBString(newColor)); } }); VBox coloredObjectsVBox = VBoxBuilder.create().alignment(Pos.CENTER).spacing(20).children(coloredText, coloredButton).build(); VBox outerVBox = VBoxBuilder.create().alignment(Pos.CENTER).spacing(150).padding(new Insets(0, 0, 120, 0)).children(standardToolbar, coloredObjectsVBox).build(); getChildren().add(outerVBox); }
Example #3
Source File: GlobalUI.java From SONDY with GNU General Public License v3.0 | 6 votes |
public void about(){ final Stage stage = new Stage(); stage.setResizable(false); stage.initModality(Modality.WINDOW_MODAL); stage.initStyle(StageStyle.UTILITY); stage.setTitle("About SONDY"); WebView webView = new WebView(); webView.getEngine().loadContent(getReferences()); webView.setMaxWidth(Main.columnWidthLEFT); webView.setMinWidth(Main.columnWidthLEFT); webView.setMaxHeight(Main.columnWidthLEFT); webView.setMinHeight(Main.columnWidthLEFT); Scene scene = new Scene(VBoxBuilder.create().children(new Label("SONDY "+Main.version),new Label("Main developper: Adrien Guille <[email protected]>"),webView).alignment(Pos.CENTER).padding(new Insets(10)).spacing(3).build()); scene.getStylesheets().add("resources/fr/ericlab/sondy/css/GlobalStyle.css"); stage.setScene(scene); stage.show(); }
Example #4
Source File: SearchBoxSample.java From marathonv5 with Apache License 2.0 | 5 votes |
public SearchBoxSample() { String searchBoxCss = SearchBoxSample.class.getResource("SearchBox.css").toExternalForm(); VBox vbox = VBoxBuilder.create().build(); vbox.getStylesheets().add(searchBoxCss); vbox.setPrefWidth(200); vbox.setMaxWidth(Control.USE_PREF_SIZE); vbox.getChildren().add(new SearchBox()); getChildren().add(vbox); }
Example #5
Source File: InsetTextButtonSample.java From marathonv5 with Apache License 2.0 | 5 votes |
public InsetTextButtonSample() { String insetTextCss = InsetTextButtonSample.class.getResource("InsetTextButton.css").toExternalForm(); VBox vbox = VBoxBuilder.create().id("insettextvbox").spacing(10).padding(new Insets(10)).children( ButtonBuilder.create().text("Inset Text Button").id("button1").build(), ButtonBuilder.create().text("Plain Text Button").id("button2").build()).build(); vbox.getStylesheets().add(insetTextCss); getChildren().add(vbox); }
Example #6
Source File: SearchBoxSample.java From marathonv5 with Apache License 2.0 | 5 votes |
public SearchBoxSample() { String searchBoxCss = SearchBoxSample.class.getResource("SearchBox.css").toExternalForm(); VBox vbox = VBoxBuilder.create().build(); vbox.getStylesheets().add(searchBoxCss); vbox.setPrefWidth(200); vbox.setMaxWidth(Control.USE_PREF_SIZE); vbox.getChildren().add(new SearchBox()); getChildren().add(vbox); }
Example #7
Source File: InsetTextButtonSample.java From marathonv5 with Apache License 2.0 | 5 votes |
public InsetTextButtonSample() { String insetTextCss = InsetTextButtonSample.class.getResource("InsetTextButton.css").toExternalForm(); VBox vbox = VBoxBuilder.create().id("insettextvbox").spacing(10).padding(new Insets(10)).children( ButtonBuilder.create().text("Inset Text Button").id("button1").build(), ButtonBuilder.create().text("Plain Text Button").id("button2").build()).build(); vbox.getStylesheets().add(insetTextCss); getChildren().add(vbox); }
Example #8
Source File: ColorPickerDemo.java From netbeans with Apache License 2.0 | 5 votes |
private void init(Stage primaryStage) { Group root = new Group(); primaryStage.setScene(new Scene(root)); final ColorPicker colorPicker = new ColorPicker(Color.GRAY); ToolBar standardToolbar = ToolBarBuilder.create().items(colorPicker).build(); final Text coloredText = new Text("Colors"); Font font = new Font(53); coloredText.setFont(font); final Button coloredButton = new Button("Colored Control"); Color c = colorPicker.getValue(); coloredText.setFill(c); coloredButton.setStyle(createRGBString(c)); colorPicker.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent t) { Color newColor = colorPicker.getValue(); coloredText.setFill(newColor); coloredButton.setStyle(createRGBString(newColor)); } }); VBox coloredObjectsVBox = VBoxBuilder.create().alignment(Pos.CENTER).spacing(20).children(coloredText, coloredButton).build(); VBox outerVBox = VBoxBuilder.create().alignment(Pos.CENTER).spacing(150).padding(new Insets(0, 0, 120, 0)).children(standardToolbar, coloredObjectsVBox).build(); root.getChildren().add(outerVBox); }
Example #9
Source File: StyledToolBarSample.java From marathonv5 with Apache License 2.0 | 3 votes |
public StyledToolBarSample() { ToolBar standardToolbar = createToolBar("standard"); String styledToolBarCss = StyledToolBarSample.class.getResource("StyledToolBar.css").toExternalForm(); ToolBar darkToolbar = createToolBar("dark"); darkToolbar.getStylesheets().add(styledToolBarCss); ToolBar blueToolbar = createToolBar("blue"); blueToolbar.getStylesheets().add(styledToolBarCss); getChildren().add(VBoxBuilder.create().spacing(10).padding(new Insets(10)).children(standardToolbar, darkToolbar, blueToolbar).build()); }
Example #10
Source File: StyledToolBarSample.java From marathonv5 with Apache License 2.0 | 3 votes |
public StyledToolBarSample() { ToolBar standardToolbar = createToolBar("standard"); String styledToolBarCss = StyledToolBarSample.class.getResource("StyledToolBar.css").toExternalForm(); ToolBar darkToolbar = createToolBar("dark"); darkToolbar.getStylesheets().add(styledToolBarCss); ToolBar blueToolbar = createToolBar("blue"); blueToolbar.getStylesheets().add(styledToolBarCss); getChildren().add(VBoxBuilder.create().spacing(10).padding(new Insets(10)).children(standardToolbar, darkToolbar, blueToolbar).build()); }