javafx-8

Java FX 8 table row highlighting

风流意气都作罢 提交于 2019-12-08 12:54:46
问题 I have a Java FX8 Table, I have populated it using an observable list. The table is displaying the populated data. During user interaction a new row is created, I add this new data to the observable list. The table gets refreshed. I know how to move focus as well as to scroll to this newly added row. However I want this row to be highlighted to show that it is newly added. How do I get a reference to the whole row as a Node, so that I can use this node value to highlight the row. 回答1: Use a

Self-Contained Application Packaging for a JavaFX app on Windows: InnoSetup OR javafxpackager?

拜拜、爱过 提交于 2019-12-08 12:19:00
问题 Steam does not accept to launch a batch file that installs (with an installer) a specific JRE and then launches my app on it. So, for avoiding this problem, I want to create a "self contained app packaging" and provides a "simple" .exe to Steam, this file including the JRE and my app. I saw https://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm#A1324980 but it is a little bit complicated. I only noticed that Innosetup could help me to generate this .exe file. But another

Call event handler

随声附和 提交于 2019-12-08 11:52:34
问题 I have a TabPane with test button which calls this code: Button bt1 = new Button("Select"); bt1.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(final ActionEvent event) { TreeClass.getConnectedAgentsMap(); TreePane.getTreeView().getSelectionModel().clearAndSelect(3); } }); This code selects TreeNode into TreeView: cell.setOnMouseClicked((MouseEvent me) -> { if (!cell.isEmpty()) { /// some action } }); As you can see this event is triggered when mouse selects tree

JavaFX 8 default message icons

和自甴很熟 提交于 2019-12-08 11:48:42
问题 with the last few updates of JavaFX we have alerts. I want to get the message's default icons (error, warning, ...). In Swing, I can get the L&F message icons through some UIManager 's properties. How can I get the message's default icons in JavaFX? Are them contained in properties, or defined by CSS class? Thanks in advance. 回答1: They are defined in modena.css as .alert.confirmation.dialog-pane, .text-input-dialog.dialog-pane, .choice-dialog.dialog-pane { -fx-graphic: url("dialog-confirm.png

Java fx running on UI alternatives

℡╲_俬逩灬. 提交于 2019-12-08 10:52:11
问题 ayt.. i have a little concern here, my question is is Platform.runlater() the only way of getting back to the UI thread or are there any alternatives.. -for example- new Thread(new Runnable() { @Override public void run() { // i do something slick here Platform.runLater(new Runnable() { // is this the only way?? @Override public void run() { // TODO Auto-generated method stub TextField txt =new TextField(" internal server error -Re-try"); root.getChildren().add(txt); } }); } }).start();; i'd

JavaFX: How to correctly implement `getValueForDisplay()` on Y Axis of a XY line Graph?

∥☆過路亽.° 提交于 2019-12-08 10:38:00
问题 I am trying to implement tooltip on a line graph to show values of X and Y Axis, i am getting values at X axis correctly, but Y axis values are not getting calculated properly. I tried to do the Math, but nothing helped so far values get incorrect when we resize the window. Is there any logic which help us to calculate value on Y axis correctly? // lineChart is an object of AreaChart Or XYChart lineChart.setOnMouseMoved(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent

How to set Minimum and maximum date in Datepicker Calander in JavaFx8?

孤人 提交于 2019-12-08 08:42:45
问题 Please help. How Can we set min and max date in date picker calendar in javafx8? 回答1: Or why not minDate = LocalDate.of(1989, 4, 16); maxDate = LocalDate.now(); datePicker.setDayCellFactory(d -> new DateCell() { @Override public void updateItem(LocalDate item, boolean empty) { super.updateItem(item, empty); setDisable(item.isAfter(maxDate) || item.isBefore(minDate)); }}); No need to create an extra datepicker just to store the max date. 回答2: It is possible to limit the dates available for

Layout with overlaying nodes and anchor-like positioning

 ̄綄美尐妖づ 提交于 2019-12-08 08:31:13
问题 I try to make a layout with JavaFX that allows overlaying nodes, resizing them to match (fill) container size and aligning them to container sides. Which layout pane should I use and how to set it to achieve the layout shown on the picture. I tried to put TreeView node and SwingNode in an AnchorPane and setting anchors to fill the container, like that TreeView: top 0, left 0, bottom 0 (no right anchor to let is resize to fit content) SwingNode: all to 0 TreeView was displayed correctly but

Drag and Drop an email attachment into a javafx 8 application

China☆狼群 提交于 2019-12-08 08:12:40
问题 I am trying to implement a requirement to drag and drop documents attached in an email into a JavaFX 8 application running on jdk 8b45. I am able to drag and drop from any folder on my computer but not from an email attachment. // MY VBOX WHERE I WANT TO DROP FILES INTO VBox bkgrndDocsVBox = new VBox(10.0); bkgrndDocsVBox.setPadding(new Insets(15, 10, 5, 10)); bkgrndDocsVBox.setStyle("-fx-border-color: transparent;"); bkgrndDocsVBox.setOnDragOver((final DragEvent event) -> { mouseDragOver

How to disable hiding of combobox popup in JavaFX8?

荒凉一梦 提交于 2019-12-08 07:58:08
问题 Is there a way to constantly show combobox popup? The question was about datepicker, but it is a descendant of combobox. I want to call show() method of combobox and then constantly show it until stage is closed. The best thing that it got till now is showingProperty().addListener({ ov, old, newValue -> if (!newValue) this.show() }) It kinda works, but it hides popup and then shows it, and that is inconvinient. 回答1: The bad solution Take the popup content out of the date picker skin and use