javafx-8

How To Align Ok Button Of A Dialog Pane In Javafx?

橙三吉。 提交于 2020-01-24 04:23:30
问题 I want to align i.e Position CENTER an OK button of a DialogPane. I have tried the below code but its not working. Dialog dialog = new Dialog(); DialogPane dialogPane = dialog.getDialogPane(); dialogPane.setStyle("-fx-background-color: #fff;"); // Set the button types. ButtonType okButtonType = new ButtonType("Ok", ButtonBar.ButtonData.OK_DONE); ButtonType cancelButtonType = new ButtonType("Cancel", ButtonBar.ButtonData.CANCEL_CLOSE); dialog.getDialogPane().getButtonTypes().addAll

How To Align Ok Button Of A Dialog Pane In Javafx?

巧了我就是萌 提交于 2020-01-24 04:23:26
问题 I want to align i.e Position CENTER an OK button of a DialogPane. I have tried the below code but its not working. Dialog dialog = new Dialog(); DialogPane dialogPane = dialog.getDialogPane(); dialogPane.setStyle("-fx-background-color: #fff;"); // Set the button types. ButtonType okButtonType = new ButtonType("Ok", ButtonBar.ButtonData.OK_DONE); ButtonType cancelButtonType = new ButtonType("Cancel", ButtonBar.ButtonData.CANCEL_CLOSE); dialog.getDialogPane().getButtonTypes().addAll

Layout using the transformed bounds

 ̄綄美尐妖づ 提交于 2020-01-24 04:15:07
问题 I have scaled a node in a Pane. But the layout of the Pane take into account the bounds without any transformation. I want it to take into account the transformed bounds. For example : And the code : import javafx.application.Application; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.scene.shape.Circle; import javafx.scene.transform.Scale; import javafx.scene.transform

How load css file in javafx8

不想你离开。 提交于 2020-01-23 09:51:07
问题 javafx 8 this code is not working scene.getStylesheets().add("appCssFile.css"); give Exception Mar 25, 2014 12:21:20 PM com.sun.javafx.css.parser.CSSParser reportException WARNING: Please report java.lang.NumberFormatException at: Mar 25, 2014 12:21:20 PM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged WARNING: Resource "appCssFile.css" not found. How can i load css ? 回答1: You need an URL and call toExternalForm in order to load a css file into your project. Use the ClassLoader for

How to render 3D text in JavaFX?

最后都变了- 提交于 2020-01-23 07:36:11
问题 I'm making my first JavaFX project and I need to render some 3D text. I already put a PerspectiveCamera and I display a text node but it has a Z-dimension of 0 and I don't know how to change this. Thanks in advance! 回答1: Have a look at the FXyz project. It already contains a Text3DMesh class that will allow you generating a 3D mesh for any string and font you need. Under the hood there is a complex process of converting (2D) Text to Path, Delaunay triangulation and mesh extrusion. As a result

“unknown protocol: data” when using data URIs in IMG tags displayed by JavaFX WebView

。_饼干妹妹 提交于 2020-01-23 02:58:04
问题 Apologies for the title, I tried to be concise, but it's hard to be in this case. I'm building an application that uses JavaFX's WebView class to display a list of SVG images. Because they need to fit into their parents' width (which can change), I was forced to use <img> tags with data URIs rather than inline <svg> (I won't go into detail on this problem here, but it's a flaw of the WebKit engine used by WebView which prevents <svg> elements from adjusting their height according to their

JavaFX Alert truncates the message? [duplicate]

我是研究僧i 提交于 2020-01-23 01:00:22
问题 This question already has answers here : JavaFX Alerts and their size (4 answers) Closed 2 years ago . I noticed that if I try to show an Alert with a long message, it tends to get truncated (at a word boundary). Example: import javafx.application.Application; import javafx.scene.control.Alert; import javafx.scene.control.Alert.AlertType; import javafx.stage.Stage; public class AlertTest extends Application { @Override public void start(final Stage primaryStage) throws Exception { new Alert

How do I get all nodes in a parent in JavaFX?

一笑奈何 提交于 2020-01-22 07:28:27
问题 In C# I found a method that was pretty sweet that allowed you to get all the descendants and all of THEIR descendants from a specified control. I'm looking for a similar method for JavaFX. I saw that the Parent class is what I want to work with since it is the class from which all Node classes that bear children are derived. This is what I have so far (and I haven't really found anything on google with searches like "JavaFX get all nodes from a scene"): public static ArrayList<Node>

How to show a list on table column, with few fields of list items

Deadly 提交于 2020-01-22 02:46:06
问题 UPDATE : This qustion moved to TableColumn should only show one specific value of a complex data type because it's more specific I want to populate a table with a complex data type Person containing name , id and a List<Person> . At the moment I get a table with the correct name , id and a third column with the whole information of other Person s but it should only show the name of the Persons s. Is there any way that my third column shows only the Person.getName() values? Keywords, solutions

Save JavaFX scene into FXML file

孤街浪徒 提交于 2020-01-21 12:53:18
问题 Anyone knows how to save a JavaFX scene into FXML file that can be loaded by the JavaFX FXMLLoader? The SceneBuilder allows to do it, but if I build the scene manually, how I can save it into FXML file? 回答1: If you mean build a fxml file from a running screen built in Java, the short answer is that you can't. The fxmlLoader is designed to work only to load files, it references the class XMLInputFactory but not the XMLOutputFactory. If you would like to do it by yourself, it is not only