javafx

JavaFX BarChart doesn't update

雨燕双飞 提交于 2019-12-25 13:31:03
问题 I have the following Controller for my window: package window; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.chart.BarChart; import javafx.scene.chart.CategoryAxis; import javafx.scene.chart.NumberAxis; import javafx.scene.chart.XYChart; import java.util.Map; import java.util.SortedMap; public class StatisticsController { @FXML private BarChart<String, Number> barChartHistogram; private SortedMap<String, Integer> _points; final CategoryAxis xAxis = new

Changing background color (or just color) of row (javafx)

我们两清 提交于 2019-12-25 13:14:43
问题 I've a TableView . I want to change background color of rows according to some condition. For instance, if balance ( getBalance() ) is less than zero - set background color of that row to red. Here is my setCellValueFactory : tc_proj_number.setCellValueFactory(cellData -> new SimpleStringProperty(cellData.getValue().getId().toString())); tc_proj_date.setCellValueFactory(cellData -> new SimpleStringProperty(cellData.getValue().getValueDate().toInstant().atZone(ZoneId.systemDefault())

JavaFX: How to add serveral series dynimically on Area Chart and delete line(series) from chart?

会有一股神秘感。 提交于 2019-12-25 13:08:48
问题 I am working with Area Chart of JavaFX. I want to add series dynamically after user will enter values in text fields and press Add button. I also want to add delete and undo functionality in it. Delete functionality working would be like for instance if there are several lines on the Area Chart each line represents series, user can delete any line he want by clicking on that line and after clicking on delete button. I also want to add undo functionality so user can undo his actions. The

Also select parents up to the root when selecting child in TreeTableView

北城以北 提交于 2019-12-25 11:57:15
问题 We try to achieve the following: When a node gets selected in a JavaFX TreeTableView , also "the path to the root", i.e., the parent, the grandparent, and so on should get selected. Selected in this case means highlighted with a different background color , see the image (in the example, the node on Level 2 has been clicked by the user). Is there a built-in function how to achieve this? We tried using CSS but did not succeed. 回答1: There's no "built-in function" to do this. Use a row factory

Also select parents up to the root when selecting child in TreeTableView

旧城冷巷雨未停 提交于 2019-12-25 11:56:07
问题 We try to achieve the following: When a node gets selected in a JavaFX TreeTableView , also "the path to the root", i.e., the parent, the grandparent, and so on should get selected. Selected in this case means highlighted with a different background color , see the image (in the example, the node on Level 2 has been clicked by the user). Is there a built-in function how to achieve this? We tried using CSS but did not succeed. 回答1: There's no "built-in function" to do this. Use a row factory

How do I make JavaFX MediaView stretch and shrink media to fill/fit parent container?

泄露秘密 提交于 2019-12-25 10:20:13
问题 How do I make JavaFX MediaView stretch and shrink media to fill/fit parent container? There's already a question here: How do I make JavaFX MediaView stretch media to fill parent container? and the solution with this code: <Pane fx:id="mediaViewPane"> <children> <MediaView fx:id="videoView" fitHeight="${mediaViewPane.height}" fitWidth="${mediaViewPane.width}" layoutX="1.0" /> </children> </Pane> works for making the video bigger to fill the container, but it doesn't allow the container to be

Animate along path with additional requirements

最后都变了- 提交于 2019-12-25 09:58:57
问题 For a game I am developing I want to animate an object along a path. There are three sides to this; therefore I am unsure what approach is the best solution. The path animation Currently the path is made up as a series of points which means I am using Path with only straight lines. However I intend to change this later on to a Bézier curve. Currently the points are at a distance between 5 and 8 pixels. I also intend to reduce the number of control points on the curve. When saying animation I

Animate along path with additional requirements

梦想与她 提交于 2019-12-25 09:58:30
问题 For a game I am developing I want to animate an object along a path. There are three sides to this; therefore I am unsure what approach is the best solution. The path animation Currently the path is made up as a series of points which means I am using Path with only straight lines. However I intend to change this later on to a Bézier curve. Currently the points are at a distance between 5 and 8 pixels. I also intend to reduce the number of control points on the curve. When saying animation I

setCellValueFactory for dynamic number of column in javaFX

≯℡__Kan透↙ 提交于 2019-12-25 09:42:17
问题 I making a logging GUI and my main view is a TableView with columns name loaded from a config file. String format="Type:Date:Message"; //OR String format="A:Different:Number:Of:Column"; String[] tok = format.split(":"); logTable.getColumns().clear(); for (String s : tok) { TableColumn<LogLine, String> col = new TableColumn<LogLine, String>(s); logTable.getColumns().add(col); } This works as expected. (I see the corrects column headers in my app). Then I want to add a CellValueFactory for each

UI goes not responding in JavaFx

那年仲夏 提交于 2019-12-25 09:40:54
问题 We have application which is Integrated with Network device for performance and tuning related functionalities. We are using JavaFx For UI, when ever i connect to Network device,for login and get responses the UI Show "Not Responding". could any one suggest how to over come the issue.Login screen shows not respongding 回答1: The UI goes not responding because the program is connecting to the network device and the UI is being run in the same Thread . You need to start a new Thread to connect