javafx

Error: Could not find or load main class application.Main Caused by: java.lang.NoClassDefFoundError: javafx/application/Application JDK 11

人盡茶涼 提交于 2020-01-22 12:57:58
问题 I am stuck at a very basic problem. I have created a simple hello world program using JavaFX which works fine on JDK 1.8. But when I switch to JDK-11 it throws following exception: Error: Could not find or load main class application.Main Caused by: java.lang.NoClassDefFoundError: javafx/application/Application Following is the code I wrote in eclipse. package application; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.stage.Stage; import javafx.scene

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>

JavaFx-when fxml inject object field?

拟墨画扇 提交于 2020-01-22 02:50:11
问题 I'm new to javaFx,and I have found only within the @fxml function and initialize function the @fxml field not be null otherwise the @fxml field will always be null,is it true? If so,how can i use a @fxml field immediately after i load a fxml(do not use lookup),just like this?(the code follow will throw a null exception) @FXML Label resultTF; .... FXMLLoader loader=new FXMLLoader(); loader.setController(this); Parent pane = loader.load(getClass().getResource("/fxml/Main.fxml")); this.resultTF

CSS not finding JavaFX rules

依然范特西╮ 提交于 2020-01-22 02:47:07
问题 I am currently trying to style my JavaFX project with CSS, and each time I try to implement a property, it says "no rule for ___ found!". I have tried -fx-font-family: and -fx-background-color:. I am using Eclipse 2019-09. EDIT: Minimal Reproductive Example: application.css in a JavaFX project in Eclipse 2019-09 .label { -fx-font-family: Helvetica; } Shows the message "no rule for -fx-font-family found!" and underlines the -fx-font-family line in yellow. 来源: https://stackoverflow.com

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

Can't create a EntityManager in JavaFx

笑着哭i 提交于 2020-01-22 02:24:06
问题 I'm experiencing a very unpleasing and not clear case with JPA and JavaFx , I tried to ask about this in two other threads which are : JPA EntityManager and JavaFx and Entity Manager not working in JavaFX but I was obliged to open a new thread here : the situation : I am using NetBeans and Postgres , JavaFx Fxml Application , what first I do is that I add a persistence unit which gives this : after working with the given advice and reading this page http://tomee.apache.org/jpa-concepts.html I

Can't create a EntityManager in JavaFx

浪尽此生 提交于 2020-01-22 02:24:06
问题 I'm experiencing a very unpleasing and not clear case with JPA and JavaFx , I tried to ask about this in two other threads which are : JPA EntityManager and JavaFx and Entity Manager not working in JavaFX but I was obliged to open a new thread here : the situation : I am using NetBeans and Postgres , JavaFx Fxml Application , what first I do is that I add a persistence unit which gives this : after working with the given advice and reading this page http://tomee.apache.org/jpa-concepts.html I

Is it possible to set different colors for different lines in a javafx textField/Area?

ⅰ亾dé卋堺 提交于 2020-01-21 23:54:17
问题 I know that you can set a color of a whole textArea/Field by setting the style of the node to be -fx-text-fill: red; but is there a way to set the color of one single line instead of all of the lines while still keeping the textArea/Field editable? 回答1: JavaFX's TextField / TextArea does not support that. You can use RichTextFX for the job: import org.fxmisc.richtext.InlineCssTextArea; InlineCssTextArea area = new InlineCssTextArea(); // set style of line 4 area.setStyle(4, "-fx-fill: red;");

Is it possible to set different colors for different lines in a javafx textField/Area?

十年热恋 提交于 2020-01-21 23:53:12
问题 I know that you can set a color of a whole textArea/Field by setting the style of the node to be -fx-text-fill: red; but is there a way to set the color of one single line instead of all of the lines while still keeping the textArea/Field editable? 回答1: JavaFX's TextField / TextArea does not support that. You can use RichTextFX for the job: import org.fxmisc.richtext.InlineCssTextArea; InlineCssTextArea area = new InlineCssTextArea(); // set style of line 4 area.setStyle(4, "-fx-fill: red;");

javaFX webview window.onload is fired before loadworker succeeds

送分小仙女□ 提交于 2020-01-21 22:37:53
问题 I use a JavaFX webview in my application. With the following code I set a member after the page has been loaded webEngine.getLoadWorker().stateProperty().addListener(new ChangeListener<Worker.State>() { @Override public void changed(ObservableValue ov, Worker.State oldState, Worker.State newState) { if (newState == Worker.State.SUCCEEDED) { JSObject window = (JSObject) webEngine.executeScript("window"); window.setMember("mymember", new JavaScriptBridge(this)); } } }); Now in javascript I can