javafx-8

How can I avoid the display of percentage values, when using the ProgressIndicator of JavaFX UI Controls

狂风中的少年 提交于 2019-12-02 08:24:38
I am pretty new to Java and would like get rid of the displayed percentage value of the ProgressIndicator in Java FX. Is there a method to disable the value display? I checked the documentation , but as far as I understand it and couldn't find the right method. Thank you for your help!! Editing the Text value Since the Text node used for displaying the progress value is hidden in an inner class within the ProgressIndicatorSkin class, the best way to access it is using lookups, trying to find this node by its styleclass percentage . This snippet will just remove the % character. private Text

How to pass data from JavaScript to JavaFX

妖精的绣舞 提交于 2019-12-02 08:06:14
问题 In my JavaFX application, I have a WebView to load HTML contents. Is there a way to pass Javascript variables and manipulate it in JavaFX App. Let's say I have a variable FULLNAME in Javascript and I want to display it in a TextField in JavaFX. Is it possible? Can you give an example. 回答1: It is possible - assuming your webview is in a webView variable, and you want your FULLNAME variable loaded into fullNameField , try executing this on the Java side: String fullName = (String) webview1

JavaFX and SwingNode - partial black Window

半城伤御伤魂 提交于 2019-12-02 07:54:11
I tried to use Swing Components in JavaFX with the SwingNode: public class MyTest extends Application { @Override public void start(Stage stage) { final SwingNode swingNode = new SwingNode(); FlowPane pane = new FlowPane(); Button btn = new Button("1"); btn.setVisible(false); pane.getChildren().add(btn); createAndSetSwingContent(swingNode); pane.getChildren().add(swingNode); stage.setScene(new Scene(pane, 100, 50)); stage.show(); btn.setVisible(true); } private void createAndSetSwingContent(final SwingNode swingNode) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() {

JavaFX 8 - How to change the color of the prompt text of a NOT editable combobox via CSS?

怎甘沉沦 提交于 2019-12-02 07:48:13
问题 The title says everything. I want to change the color of the prompt text of a not editable combobox , so that the text has the same color like the prompt text of a editable combobox . In my CSS-file I tried to use -fx-prompt-text-fill in .combo-box , .combo-box-base , .combo-box-base .text-field and .combo-box-base .text-input , but nothing worked. What styleclass do I have to use? 回答1: When the ComboBox is not editable, there is no TextField , and the property -fx-prompt-text-fill is no

How to draw a line from the point to X axis, in the JavaFX ScatterChart?

只愿长相守 提交于 2019-12-02 07:30:16
Now I am work with JavaFX ScatterChart and I need to draw a line from the point of data to X axis, as I show in the image below. Thak you for your help!! Roland You'll have to create a custom chart and add the lines as custom nodes. This is very similar to the marker lines in the answer to the Adding a line in a JavaFX chart question. 来源: https://stackoverflow.com/questions/29463467/how-to-draw-a-line-from-the-point-to-x-axis-in-the-javafx-scatterchart

Unable to run the javafx project using command line

萝らか妹 提交于 2019-12-02 07:18:56
问题 I recently had created the javafx project in eclipse, I successfully ran in eclipse and it just works fine. I wanted to run my project using the command line interface. I am able to compile successfully but not able to run and it keeps on giving "Error: could not find or load main class Main" Compile command (Works fine): javac -cp "C:\Program Files (x86)\Oracle\JavaFX 2.2 Runtime\lib\jfxrt.jar" Main.java Main.class is created after the above command. Run Command (doesn't work): java -cp "C:

Detect Hyperlink hover in WebView and print the link

若如初见. 提交于 2019-12-02 07:13:01
I want to add the hovered Hyperlink from a WebView and display it in a corner. How can i achieve? It should be like Chromes feature: Example-Chrome-Screenshot Example WebView Code with many links: import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.ScrollPane; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; import javafx.stage.Stage; public class core extends Application { @Override public void start(final Stage stage) { Scene scene = new Scene(new Group()); final WebView browser = new WebView(); final

JavaFX (8) Alert: different button sizes

瘦欲@ 提交于 2019-12-02 07:01:22
Consider a JavaFX (8) Alert dialog with two buttons: Alert alert = new Alert(AlertType.CONFIRMATION); ButtonType bttYes = new ButtonType("Yes"); ButtonType bttNo = new ButtonType("No, continue without restart"); alert.getButtonTypes().clear(); alert.getButtonTypes().addAll(bttYes, bttNo); alert.showAndWait(); The resulting dialog has two buttons, both same width which looks quite silly. Is there a way to adjust both buttons to the actual text length? An Alert , which extends Dialog , wraps a DialogPane . A DialogPane is split into different sections and one of those sections is the "button bar

JavaFX weird (Key)EventBehavior

坚强是说给别人听的谎言 提交于 2019-12-02 06:54:33
问题 So I have been experimenting with it a litle bit with javaFX and I came across some rather weird behavior which might be linked to the TableView#edit() method. I'll post a working example on the bottom of this post again, so you can see what exactually is happening on which cell (debuging included!). I'll try to explain all the behavior myself, though its way easier to see it for yourself. Basically the events are messed up when using the TableView#edit() method. 1: If you are using the

Unable to run the javafx project using command line

十年热恋 提交于 2019-12-02 06:42:37
I recently had created the javafx project in eclipse, I successfully ran in eclipse and it just works fine. I wanted to run my project using the command line interface. I am able to compile successfully but not able to run and it keeps on giving "Error: could not find or load main class Main" Compile command (Works fine): javac -cp "C:\Program Files (x86)\Oracle\JavaFX 2.2 Runtime\lib\jfxrt.jar" Main.java Main.class is created after the above command. Run Command (doesn't work): java -cp "C:\Program Files (x86)\Oracle\JavaFX 2.2 Runtime\lib\jfxrt.jar;." Main I would like to know what am I