javafx-8

Is there a way to compile / load fxml files faster and only one time, and not at every restart of an application?

时光毁灭记忆、已成空白 提交于 2020-01-27 18:43:33
问题 I have a program which loads many fxml files when executed. The application will be finished in a short time, and loading the application just takes too long. There are many fxml files (20+) and all these fxml files are loaded with Java code. There will be a point that the application is finished and ready for use, but all files will be loaded with every execution of the program. Can the fxml files only be compiled once, because they won't be changed when finished? The java code will of

Is there a way to compile / load fxml files faster and only one time, and not at every restart of an application?

时光毁灭记忆、已成空白 提交于 2020-01-27 18:35:38
问题 I have a program which loads many fxml files when executed. The application will be finished in a short time, and loading the application just takes too long. There are many fxml files (20+) and all these fxml files are loaded with Java code. There will be a point that the application is finished and ready for use, but all files will be loaded with every execution of the program. Can the fxml files only be compiled once, because they won't be changed when finished? The java code will of

JavaFX TreeTableView - Prevent selection of certain TreeItems

不问归期 提交于 2020-01-26 04:06:06
问题 I have looked at a couple of questions here, but I can't seem to find anything related to disabling selection of rows for TreeTableViews in particular in JavaFX. The closest related questions I have come across are all related to TreeViews: How to make certain JavaFX TreeView nodes non-selectable? TreeView - Certain TreeItems are not allowed to be selected The answer given in question 2 where a custom selection-model is used that extends from MultipleSelectionModel seems to be the most

JavaFx: How to keep the window maximizing?

十年热恋 提交于 2020-01-25 12:49:25
问题 My app, if I click the "maximize button", it will maximize the window. But if I go to another scene(in the same stage), the window will restore to the original size. So, how can I control it to keep maximizing? 回答1: I used primaryStage.setMaximized(true); after calling show(); method in Java 8 implementation. It keeps other scenes maximizing. 回答2: I had the same problem. I fixed it creating a root stage with that only contains a menu bar and a tool bar, like this: I initialized this window in

Want to trigger scroll when dragging node outside the visible area in ScrollPane

南楼画角 提交于 2020-01-25 11:53:29
问题 We have been working on an application that uses a ScrollPane containing an AnchorPane that can grow depending on what nodes get placed on the workspace. We are able to place nodes on the workspace and are able to drag them to different positions using mouse drag events. What I am now trying to implement is a way to automatically scroll the workspace when we are dragging a node and it touches the edge of the visible workspace. I have been able to detect the point when the node begins to move

JavaFX TextFlow set default text color

[亡魂溺海] 提交于 2020-01-25 07:59:43
问题 As the title, it's possible to to apply a default color to all text of a TextFlow component? TextFlow textFlow = new TextFlow(); textFlow.setId("supertextflow"); // Somewhere else in the code textFlow.getChildren() .add(new Text("Dynamic added text! OMG!")); I tryed different solution but none of them works #supertextflow { -fx-text-fill: red; } #supertextflow * .text{ -fx-fill: red; } #supertextflow > * > .text { -fx-fill: red; } I know that Text is another component, but why i can't style

Refreshing a column of comboboxes in a table view, javafx

喜夏-厌秋 提交于 2020-01-25 07:39:06
问题 so i have a table view with 3 columns and one of them is a column of comboboxes, the way i create the column of combobox is as so Source = new TableColumn<>("Configure Interface as.."); Source.setCellValueFactory(i -> { final StringProperty value = i.getValue().optionProperty(); // binding to constant value return Bindings.createObjectBinding(() -> value); }); Source.setCellFactory(col -> { TableCell<TableViewTest, StringProperty> c = new TableCell<>(); ComboBox<String> comboBox = new

How can I set the JavaFX Slider to format for time?

女生的网名这么多〃 提交于 2020-01-25 04:47:04
问题 I have created a Slider using JavaFX. I`m trying to set it up so that it shows time in minutes. I have been able to setup the the minutes to range from 0 - 60. My problem is my minutes are showing correctly but my seconds are between 0 - 100. How can I fix this? Here is how I created the slider <ScrollPane fx:id="RulerScroll1" hbarPolicy="NEVER" maxHeight="40" minHeight="40" pannable="true" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="2"> <Slider fx:id="Ruler1"

Periodically refresh data

孤街醉人 提交于 2020-01-24 12:03:25
问题 I want to display data periodically but I get error when I try to display the data. Timeline fiveSecondsWonder = new Timeline(new KeyFrame(Duration.seconds(3), new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { GridPane gp = new GridPane(); gp.setPadding(new Insets(10, 10, 10, 10)); gp.setHgap(20); gp.setVgap(10); //gp.setGridLinesVisible(true); gp.add(new Label("Operating System Name"), 0, 0); gp.add(new Label(System.getProperty("os.name")), 1, 0); gp.add(new

Using queries containing pseudo-classes in JavaFX

老子叫甜甜 提交于 2020-01-24 11:28:12
问题 I'm tring to use pseudo classes in programmtic query using Node.lookupAll() however this seems to give unexpected results. I've searched online and can't find anything to suggest Node.lookupAll() wouldn't support psuedo classes... public class Foo extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) throws Exception { PseudoClass pseudoClass = PseudoClass.getPseudoClass("custom"); Label a = new Label(); a.getStyleClass(