javafx-8

JavaFX 2.1 TableView refresh items

只愿长相守 提交于 2019-12-17 02:30:48
问题 I have this common issue, as it appears to be. My table view wont refresh my items after I reset them. I have checked the data and it's the new one. I tried multiple solution from internet but no success. Can't reset all the columns because it adds one empty one extra (dont know why) and the resize just breakes. My table is not editable . The new data is changed. The data is refreshed if I change the ordering of the items and the rows change (:|). I'm just left without ideas. At the moment

javafx 8 compatibility issues - FXML static fields

倾然丶 夕夏残阳落幕 提交于 2019-12-16 18:51:53
问题 I have designed a javafx application which works fine in jdk 7. When I try to run it in java 8 I am getting the below exceptions: javafx.fxml.LoadException: at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2617) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2595) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3230) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3191) at javafx.fxml.FXMLLoader.loadImpl

javafx 8 compatibility issues - FXML static fields

回眸只為那壹抹淺笑 提交于 2019-12-16 18:51:02
问题 I have designed a javafx application which works fine in jdk 7. When I try to run it in java 8 I am getting the below exceptions: javafx.fxml.LoadException: at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2617) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2595) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3230) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3191) at javafx.fxml.FXMLLoader.loadImpl

set text for javafx.scene.text.Text through css

心不动则不痛 提交于 2019-12-14 03:57:35
问题 I need to store entire node properties in css for any JavaFX element or mainly for javafx.scene.text.Text or javafx.scene.shape. For Text I'm not sure how to set text value though css. Is it possible? I need to store all properties in css so that I can easily recreate same element with applied properties with help of this css. TIA 回答1: According to the official CSS documentation for Text nodes this is not possible, there does not appear to be an equivalent of the web CSS content attribute

Rotating label 90 degrees takes up unnecessary horizontal space

烂漫一生 提交于 2019-12-14 03:45:38
问题 This question is based on Javafx rotate Label issue, but because this post is outdated and has no satisfying answer, I would like to mention it again. The problem is: When rotating a label for 90 or 270 degrees, firstly the text is being truncated because it has not the right minimum width. When I set the minimum width, the text is not being truncated anymore. However, the minimum width is also set in the horizontal direction, as shown below: On the left is the situation as it is now in Java

Add fixed positioned layer to FlowPane [duplicate]

∥☆過路亽.° 提交于 2019-12-14 03:31:38
问题 This question already has answers here : Add fixed positioned Combobox inside FlowPane (2 answers) Closed 6 years ago . I have a FlowPane with panels which will be used to display data in front of the user. ![enter image description here][1] I added also scrollpane when the number of the panels is bigger than the visible area. I also want to add filter which will sort the panels by type and will display only the appropriate. The red area will hold the ComboBox which will be the filter. And as

Change JavaFX progress bar style

隐身守侯 提交于 2019-12-13 21:00:58
问题 I want to modify this code and make the progress bar green: .progress-bar > .bar { -fx-background-color: linear-gradient( from 0px .75em to .75em 0px, repeat, -fx-accent 0%, -fx-accent 49%, derive(-fx-accent, 30%) 50%, derive(-fx-accent, 30%) 99% ); } How I can modify the code to change the visual layout? 回答1: Simply overwrite the color constant -fx-accent the gradient colors are derived from: .progress-bar > .bar { -fx-accent: green; -fx-background-color: linear-gradient( from 0px .75em to

Nullpointer Exception during initialize / FXML injection not working as expected

自作多情 提交于 2019-12-13 20:16:16
问题 I noticed a weird behaviour in one of my controller classes. One of the components is not getting initialized. This is the fxml: <?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <AnchorPane id="AnchorPane" prefHeight="500.0" prefWidth="712.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="modulartoolkit.ConfigWindowController">

How to take snapshot of selected area of screen in javafx?

谁说胖子不能爱 提交于 2019-12-13 17:02:31
问题 I am trying to take screeshots of any file open currently on screen. After google all i got is to take screenshot of scene only in javafx. I don't want to use any AWT or Swing component. So is there any way ? 回答1: This is the main mechanism I have used: A transparent Stage with Transparent Canvas which has a BorderPane with Opacity 0.1 Here is the simple example (it is just for selecting areas...): WHEN YOU START THE APP THE ONLY WAY TO CLOSE IT IS USING ESCAPE Tester class: import javafx

How to implement collision detection on nodes which are in StackPane (in JavaFX)?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 16:52:38
问题 I am trying to check collision detection on the nodes which are inside StackPane. Below is my code: public void start(Stage primaryStage) throws Exception { StackPane pane = new StackPane(); Scene scene = new Scene(pane,300,300,Color.GREEN); primaryStage.setScene(scene); primaryStage.show(); Rectangle rect1 = new Rectangle(50, 50); rect1.setFill(Color.BLUE); Rectangle rect2 = new Rectangle(50, 50); pane.getChildren().add(rect1); pane.getChildren().add(rect2); TranslateTransition