javafx-8

What the easiest way to animate a Path as an object traverses it?

别等时光非礼了梦想. 提交于 2019-12-02 04:08:42
Consider a rectangle traversing a long, linear path. It would be useful to figure out where the shape had gone earlier in the animation. Displaying the entire path before the shape moves is not what I want. That is easily done by adding the path to the pane. I want a trailing line behind the shape representing the path that the shape has traversed through so far. Does anyone know how to do this in Javafx? I am using Path and PathTransition to animate my object along a path. Roland There are various solutions. Depending on which one you choose decides your outcome. You could use a Canvas and

Disable pagination animation for javafx 8

夙愿已清 提交于 2019-12-02 04:05:17
I am trying to convert the solution from stackoverflow thread: Disable pagination animation it is too complicated to do it with JavaFX 8 because Utils is and other classes like SkinBase have changed with different arguments. does anyone have a working example with pagination animation disabled for JavaFX8 ? Ok, I did it! using Gabriel Féron answer from : https://gist.github.com/gferon/4626632 I've translated it to JavaFX8: first create an -fx-skin on css of scene you want to disable pagination animation: .pagination { -fx-border-color: #0E5D79; -fx-skin: "com.sun.javafx.scene.control.skin

How to pass data from JavaScript to JavaFX

会有一股神秘感。 提交于 2019-12-02 04:01:45
In my JavaFX application, I have a WebView to load HTML contents. Is there a way to pass Javascript variables and manipulate it in JavaFX App. Let's say I have a variable FULLNAME in Javascript and I want to display it in a TextField in JavaFX. Is it possible? Can you give an example. It is possible - assuming your webview is in a webView variable, and you want your FULLNAME variable loaded into fullNameField , try executing this on the Java side: String fullName = (String) webview1.getEngine().executeScript("FULLNAME;"); fullNameField.setText(fullName); 来源: https://stackoverflow.com/questions

JavaFX PieChart Tooltip not showing despite being installed

巧了我就是萌 提交于 2019-12-02 03:36:05
I tried displaying a tooltip for each "slice" of a PieChart similar to this in chart.js: I found this answer basically trying to achieve the same in the same framework. It has two upvotes and the same seemed to work on other chart types judging by other (accepted) answers. However the code would not really work for me in the sense that there was no tooltip showing up. Example code showing the problem: import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.chart.PieChart; import javafx.scene.control.Button; import javafx.scene.control.Tooltip; import javafx.scene

JavaFX TableView scrollTo() causing wrong row to start editing

二次信任 提交于 2019-12-02 03:25:43
问题 I have an editable TableView with a button that adds a new row then calls table.edit() on the first column in that row. When a user wants to add a row that will be out of the viewport, what should happen is the table scrolls the new row within the viewport and starts editing. However, calling table.scrollTo(newRow) causes all sorts of buggy behavior. The row is brought into view, but only some of the time goes into editing. What seems to happen the most is the first row within the viewport

JavaFX: Handle ComboBox selection event which is inside the TableView Column

天涯浪子 提交于 2019-12-02 03:24:13
I have a javafx TableView and I want custom controls inside the columns. Say I want a TextField in column1 and ComboBox in column2 and DatePicker in column3 . I know that I should create a class that extends TableCell and override the updateItem() method.... But I read that specifically for this purpose we have default classes like ComboBoxTableCell , TextFieldTableCell etc in the cell package and it is recommended to use them. So I'm able to achieve this with the below code. loadingStatusTableColumn.setCellFactory(ComboBoxTableCell.forTableColumn("Off", "Load All", "Load By Time"));

JavaFx: How to update text of dynimically created TextFields inside GridPane?

夙愿已清 提交于 2019-12-02 03:22:51
I'm developing an app in JavaFx, in which which I'm dynamically creating TextFeids and CheckBoxes inside GridPane like this: I'm adding numbers which user will enter in TextField 1 and TextField 2 and displaying in TextField 3 like this using listener: Problem: What I want is when user will check the CheckBox it should add 10 to the value already present in the TextField 3 of (same row as of triggered CheckBox) and update the text of TextField 3, and when user will uncheck the CheckBox it should subtract 10 from the value present in the TextField 3 of (same row as of triggered CheckBox) and

Java FX changing value of Label from different scene

蓝咒 提交于 2019-12-02 02:53:27
I have two scenes. The first scene invokes second scene using the following code. @FXML private void confirmation(ActionEvent event) throws IOException{ Stage confirmation_stage; Parent confirmation; confirmation_stage=new Stage(); confirmation=FXMLLoader.load(getClass().getResource("Confirmation.fxml")); confirmation_stage.setScene(new Scene(confirmation)); confirmation_stage.initOwner(generate_button.getScene().getWindow()); confirmation_stage.show(); } There is a label in "Confirmation.fxml" called "Proceed". I need to change the content of that label from within this function and return

NullPointerException in JavaFX initialize in TableView

末鹿安然 提交于 2019-12-02 02:46:22
I have this controller class for showing a database query in a TableView, but i am having error of NullPointerException with the "setCellValueFactory(new PropertyValueFactory" package aplicativo; import java.net.URL; import java.util.ResourceBundle; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.TextField; import javafx.scene.control.cell.PropertyValueFactory

How to check h2 database health and corruption

南笙酒味 提交于 2019-12-02 02:31:06
I'm using h2 database in embedded mode with JavaFX 8 desktop application and I have developed an option for the user to backup and restore the database file. In the older version of the program I have used SQLite database and checking the database file was quite simple using this command pragma integrity_check. Using that command with the h2 database always throws an exception. What is the alternative for that in the h2 database? And is there an explicit or more proper way to check the h2 database file before using it? Any help or code sample is appreciated,thanks. What you could do is execute