javafx

How do you mock a JavaFX toolkit initialization?

给你一囗甜甜゛ 提交于 2020-01-01 02:08:09
问题 [preamble: apologies, there is a lot of code here, and some of it may not be relevant to this question while some code which is necessary to understand the problem may be missing; please comment, and I will edit the question accordingly.] Environment: Ubuntu 14.10 x86_64; Oracle JDK 1.8u25. Unit testing library is TestNG, version 6.8.13; Mockito is version 1.10.17. In my GUI application, what JavaFX calls a "controller" is pretty passive, in the sense that the only thing that this "controller

Generating image at server side using Java FX

陌路散爱 提交于 2020-01-01 00:46:12
问题 Currently I'm working on Jax Rs application and I want to output Base64 encoded image to the client. The client is a mobile device. The mobile device will call this service with some parameters and the server has to draw a bar chart and send it back to the device as a base64 encoded image string. Since java Fx having the required chart libraries, I did a sample using following tutorial. "snapshot" function also worked correctly as expected (to create a image of the screen). http://docs.oracle

JavaFx : How to put ImageView inside ListView

强颜欢笑 提交于 2020-01-01 00:24:12
问题 I've been searching some threads about JavaFx ListView still it's hard to look for a simple yet easy solution for putting a JavaFx ImageView inside JavaFx ListView. I am trying to create a chat application using JavaFx framework. at the photo it should look like that.This is not duplicate because the other thread is vague for a beginner like me. ListView with imageview inside I tried something like this. I'm totally noob to this thanks in advance! import javafx.application.Application; import

what is the difference between java desktop application and javafx?

那年仲夏 提交于 2019-12-31 21:53:43
问题 What is the difference between a "normal" Java desktop application (with AWT or Swing), and a Java application built with JavaFX? What are the advantages and disadvantages of each? 回答1: I think what you are asking is what are the pros and cons of building a JavaFX desktop application vs a Java Swing desktop application. After experimenting with both I can point out a few differences: Java Swing Pros: Better visual designer and IDE support More full featured set of controls Good for building

How to get the JavaFx WebEngine to report errors in detail?

邮差的信 提交于 2019-12-31 21:35:51
问题 In JavaFx I can attach a listener to the load worker for a webEngine like this: webEngine.getLoadWorker().stateProperty().addListener( new ChangeListener<Worker.State>() { public void changed(ObservableValue ov, Worker.State oldState, Worker.State newState) { System.out.println("webEngine result "+ newState.toString()); } }); However if I try to load a document at an https address such as: https://SomeLocalMachine.com:9443/jts/admin#action=com.ibm.team.repository.manageUsers all I get printed

ComboBox FXML default value

我的梦境 提交于 2019-12-31 12:42:27
问题 How can I set a default value in a ComboBox using FXML? <ComboBox fx:id="cbo_Bacteriologie_Aesculine" prefHeight="21.0" prefWidth="105.0" GridPane.columnIndex="1" GridPane.rowIndex="0"> <items> <FXCollections fx:factory="observableArrayList"> <String fx:value="NVT" /> <String fx:value="Bezig" /> <String fx:value="Positief" /> <String fx:value="Negatief" /> </FXCollections> </items> </ComboBox> I want NVT to be selected by default. I tried adding selected="selected" and such but don't seem to

ComboBox FXML default value

独自空忆成欢 提交于 2019-12-31 12:42:24
问题 How can I set a default value in a ComboBox using FXML? <ComboBox fx:id="cbo_Bacteriologie_Aesculine" prefHeight="21.0" prefWidth="105.0" GridPane.columnIndex="1" GridPane.rowIndex="0"> <items> <FXCollections fx:factory="observableArrayList"> <String fx:value="NVT" /> <String fx:value="Bezig" /> <String fx:value="Positief" /> <String fx:value="Negatief" /> </FXCollections> </items> </ComboBox> I want NVT to be selected by default. I tried adding selected="selected" and such but don't seem to

Triggering asynchronous event in gui thread

假装没事ソ 提交于 2019-12-31 07:47:06
问题 TL;DR I'm looking for a way to have one thread raise an event in another EDIT: I say the word "immediate", which is, as some commenters have pointed out, impossible. What I mean is that it should happen reasonably quickly, in the low milli to nanosecond range if the gui thread is idle (which , if I do my job right, it should be). The case example: I have a project which has a Parent class. That Parent class creates a child thread 'Gui', which houses a javafx application and implements

Update JavaFX Live nodes outside Application Thread

陌路散爱 提交于 2019-12-31 07:39:05
问题 The JavaFX Application Thread. Sources I can find says all updates on nodes must happen in this thread. I am trying to find the documentation for this and if there are any exceptions to this rule. https://docs.oracle.com/javase/8/javafx/interoperability-tutorial/concurrency.htm As it says: The JavaFX scene graph, which represents the graphical user interface of a JavaFX application, is not thread-safe and can only be accessed and modified from the UI thread also known as the JavaFX

javaFX: TableView's cellvalue is not enough to display in columns, it will be clipped, how to show a tip on such cell?

本秂侑毒 提交于 2019-12-31 07:24:10
问题 javaFX: TableView's cellvalue is not enough to display in columns, it will be clipped end of '...', how to show a tip on such cell? I need a tip because sometimes i can't drag the colunm's head. So i can't see the whole content of the cell. 回答1: Below a subclass of TableCell is used to set the ToolTip for a cell. It does not distinguish between cells in which the text fits and those where the text is too large. It is used in the cell factory for the table column. import javafx.application