javafx-8

JavaFX. Set different icons for the title bar and the operating system task bar

最后都变了- 提交于 2019-11-30 06:49:01
Is there a way in JavaFX to set different application icons for the title bar and for the operating system task bar? The problem is that the icon shown in the system task bar is much bigger compare to the icon in the title bar and they cannot be re-sized properly by the system. I would like to use different images for the different icon sizes. Similar to what you do in an .ico file. If I call stage.getIcons().add(...) two times, the former image will be always used for both bars. I was also not able to use an already existing .ico file (that supports different sizes) for this purposes. There

JavaFx Editable ComboBox : Showing toString on item selection

不想你离开。 提交于 2019-11-30 06:35:05
问题 I have a ComboBox<Perosn> of type Person , in which I have added few object of Person class, I have used setCellFactory(Callback) method to show Person name in ComboBox drop down combobox.setCellFactory( new Callback<ListView<Person >, ListCell<Person >>() { @Override public ListCell<Person > call(ListView<Person > p) { ListCell cell = new ListCell<Person >() { @Override protected void updateItem(Person item, boolean empty) { super.updateItem(item, empty); if (empty) { setText(""); } else {

Combobox clearing value issue

回眸只為那壹抹淺笑 提交于 2019-11-30 06:15:00
I've stumbled on an issue with Comboboxes in javafx2.2. This is the scenario: Users click on the 'editFile' button. Another pane becomes visible (with the setVisible method). This pane contains 6 comboboxes. Three of them have fixed items: cboReport, cboSales, cboSend. Three of them get their data from a db (ObservableList) and get populated when the pane becomes visible: cboFile, cboCustomer, cboVet The user selects a file number from the cboFile. The rest of the comboboxes are beeing set with the correct values. The user presses the save button, the file gets saved as intended. Next the user

How to commit when clicking outside an editable TableView cell in JavaFX?

核能气质少年 提交于 2019-11-30 05:01:11
I have a table cell factory responsible for creating an editable cell in a JavaFX TableView. I'm trying to implement some added functionality to the tableview so that when the user clicks outside the editable cell a commit is made (the edited text is saved, and not discarded as per the default tableview behavior.) I added an textField.focusedProperty() event handler, where I commit the text from the text field. However, when one clicks outside the current cell cancelEdit() gets called and calling commitEdit(textField.getText()); has no effect. I have come to realize that once cancelEdit() is

How to take snapshot From node which is not on the scene

吃可爱长大的小学妹 提交于 2019-11-30 04:44:02
问题 This is the case: I have a Mesh and PointLight added to the pane and I want to take snapshot from pane and show the result in the image view. But it only works when I add the pane to the scene. Is there any way to take snapshot from a node which has been not added to the scene? 回答1: Accoring to documentation of Node.snapshot NOTE: In order for CSS and layout to function correctly, the node must be part of a Scene (the Scene may be attached to a Stage, but need not be). You can create new

JavaFX 8 Dynamic Node scaling

不想你离开。 提交于 2019-11-30 04:02:46
问题 I'm trying to implement a scene with a ScrollPane in which the user can drag a node around and scale it dynamically. I have the dragging and scaling with the mouse wheel working as well as a reset zoom, but I'm having trouble with the calculations to fit the node to the width of the parent. Here is my code as an sscce. (works) Mouse wheel will zoom in and out around the mouse pointer (works) Left or right mouse press to drag the rectangle around (works) Left double-click to reset the zoom

Set two root nodes for TreeView

好久不见. 提交于 2019-11-30 01:48:19
问题 Is there a way to set two root nodes for one TreeView? I found many example if simple TreeView but there is no useful example for my case. 回答1: No: a tree only has one root node. To get the effect you want, create a dummy root node and add your two nodes to it. Create the TreeView with the dummy root node and call tree.setShowRoot(false) , so the dummy node does not appear. final TreeItem<String> root1 = new TreeItem<>("root 1"); final TreeItem<String> root2 = new TreeItem<>("root 2"); final

JavaFX Self Installer With Inno Setup 5 - Allow user to change install directory

て烟熏妆下的殇ゞ 提交于 2019-11-30 01:25:16
I am using Ant to build a self deploying EXE for a JavaFX application. Currently Inno Setup places the EXE here: C:\Users\username\AppData\Local\application name I would like to place this in a different location, and provide the user the option to override this. However I can't seem to find the ant settings to change this. Is this possible? Thanks! Actually you can't change this using ANT. However, as you already know the deploy mechanism uses Inno Setup and you can modify its behaviour. During the fx:deploy ANT task a default ApplicationName.iss file is created. This default file contains e

controlsfx Dialogs deprecated for what?

孤人 提交于 2019-11-30 00:27:58
问题 ControlsFX class Dialogs is marked as deprecated. What to use instead? 回答1: This blog post explains it all: http://fxexperience.com/2014/09/announcing-controlsfx-8-20-7/ This release has been brewing since 8.0.6 was released on May 29th – so basically four months. This is not typical for us (we normally have much quicker releases), but Eugene and I were both distracted on a major undertaking – elevating the ControlsFX dialogs API and implementation into the next release of JavaFX itself (it

How to save a high DPI snapshot of a JavaFX Canvas

旧巷老猫 提交于 2019-11-29 22:34:55
问题 I have created an image on a Canvas which is scaled down for display using a transformation. It is also in a ScrollPane which means only a part of the image is visible. I need to take a snapshot of the entire canvas and save this as a high-resolution image. When I use Canvas.snapshot I get a Writable image of the visible part of the image after scaling down. This results in a low-res partial image being saved. So how do I go about creating a snapshot which includes the entire canvas (not only