javafx

JavaFX 2: Save edit in TableCell

心已入冬 提交于 2019-12-30 11:11:49
问题 In my JavaFX-program I use a TableCell where you can edit a value. Like shown at the examples on the JavaFX-page "Example", I use this function to save the changes (function is set on TextField in edit Cell) textField.setOnKeyReleased(new EventHandler<KeyEvent>() { @Override public void handle(KeyEvent t) { if (combo.match(t)) { commitEdit(textField.getText()); } else if (t.getCode() == KeyCode.ESCAPE) { cancelEdit(); } } When using ENTER to leave the cell, the value is changed / saved, but

create a polyline in gluon mapLayer

冷暖自知 提交于 2019-12-30 10:57:32
问题 Google maps API makes it possible to create a layer on the map containing a polyline linking points together. I have searched where I could to find an example or an implementation for this for gluon's mapLayer. Please advice 回答1: While there's no explicit API for drawing lines, polylines or polygons on top of a MapView , the MapLayer is a layer where you can draw any JavaFX Shape , providing you take care of scaling it to the map coordinates. For that, if you have a look at the PoiLayer class

JavaFX Stage/Scene automatic resize

十年热恋 提交于 2019-12-30 10:49:02
问题 Like the picture showed, the red box above is a GridBox and below is a VBox with Splitpane (ListView) and Gridpane (2 Buttons). What I want to implement is to hide the VBox below, when the Button "Hide <<<" is clicked. But now, the red box below is removed by call root.getChildren().remove(child); How can the Window(Stage) or Scene automatically resizing. In the controller: public class FunctionOwnerFX extends Application{ public static String HIDE = "Hide Libraries <<<"; public static String

JavaFX Stage/Scene automatic resize

大城市里の小女人 提交于 2019-12-30 10:48:26
问题 Like the picture showed, the red box above is a GridBox and below is a VBox with Splitpane (ListView) and Gridpane (2 Buttons). What I want to implement is to hide the VBox below, when the Button "Hide <<<" is clicked. But now, the red box below is removed by call root.getChildren().remove(child); How can the Window(Stage) or Scene automatically resizing. In the controller: public class FunctionOwnerFX extends Application{ public static String HIDE = "Hide Libraries <<<"; public static String

How do I change the style of Autocomplete TextField (ControlFX)?

对着背影说爱祢 提交于 2019-12-30 10:09:12
问题 I have an Autocomplete TextField from controlsFX and I want to change the size and the color of each item. This is my part of code : TextFields.bindAutoCompletion(txt_numberOfCard_GENERAL, cardNumber); 回答1: Edit : Autocomplete from ControlFX is a Popup window contains ListView ,the default css style of AutoComplete is : /** * Style based on Modena.css combo-box-popup style */ .auto-complete-popup > .list-view { -fx-background-color: linear-gradient(to bottom, derive(-fx-color,-17%), derive(

How do I change the style of Autocomplete TextField (ControlFX)?

岁酱吖の 提交于 2019-12-30 10:09:07
问题 I have an Autocomplete TextField from controlsFX and I want to change the size and the color of each item. This is my part of code : TextFields.bindAutoCompletion(txt_numberOfCard_GENERAL, cardNumber); 回答1: Edit : Autocomplete from ControlFX is a Popup window contains ListView ,the default css style of AutoComplete is : /** * Style based on Modena.css combo-box-popup style */ .auto-complete-popup > .list-view { -fx-background-color: linear-gradient(to bottom, derive(-fx-color,-17%), derive(

How do I print only text?

て烟熏妆下的殇ゞ 提交于 2019-12-30 10:04:14
问题 I am trying to send some text to a printer. I need just the text printed, wrapped at the page margin and flowing to another page if necessary. Here is a minimal example of what I am doing now: @FXML private void print() { TextArea printArea = new TextArea(textArea.getText()); printArea.setWrapText(true); printArea.getChildrenUnmodifiable().forEach(node -> node.setStyle("-fx-background-color: transparent")); printArea.setStyle("-fx-background-color: transparent"); PrinterJob printerJob =

Multiple controller for one FXML file

夙愿已清 提交于 2019-12-30 10:00:19
问题 I have one fxml file controlled by one controller. I want to separate the controller into multiple parts as if placed in one controller makes a long code. Unfortunately, fx:controller can only be placed in the root. Are there any suggestions for me how to separate the controller? 回答1: I recommend to create custom controls - use several smaller FXML files rather than one big FXML file. Here is the tutorial: http://docs.oracle.com/javafx/2/fxml_get_started/custom_control.htm 回答2: During the

JavaFX FileChooser in swing

試著忘記壹切 提交于 2019-12-30 10:00:12
问题 I think everyone can agree that JFileChooser is really poop. So I was looking for an alternative and found out that JavaFX has got a great FileChooser class. So now the obvious question: how can I embed that neat FileChooser into my Swing application? Needless to say, I did some research before I posted this, and this is what I found so far: link to a Reddit post. The code of that JavaFXFileDialog class is very interesting, but it does not close when I exit my application (JavaFX seems to

Multiple controller for one FXML file

我只是一个虾纸丫 提交于 2019-12-30 10:00:07
问题 I have one fxml file controlled by one controller. I want to separate the controller into multiple parts as if placed in one controller makes a long code. Unfortunately, fx:controller can only be placed in the root. Are there any suggestions for me how to separate the controller? 回答1: I recommend to create custom controls - use several smaller FXML files rather than one big FXML file. Here is the tutorial: http://docs.oracle.com/javafx/2/fxml_get_started/custom_control.htm 回答2: During the