javafx-8

Not able to update url and update webview

蹲街弑〆低调 提交于 2019-12-11 08:54:23
问题 This is my project setup I'm trying to update the webview so each tab will be updated by one address bar. I cant seem to find where I'm going wrong. I'm new to javaFX. I know I have to add another change listener in there for the search button just not sure how...I cant find anything on how to do this. except one example that didnt really explain anything and the code was messy. public class Client extends Application { private Scene scene; Dimension screenSize = Toolkit.getDefaultToolkit()

JavaFX: How to calulcate average from the values of dynimically created TextFields inside GridPane?

会有一股神秘感。 提交于 2019-12-11 08:45:55
问题 I'm creating an application in JavaFx in which I'm creating two GridPanes dynimically with same number of rows, both GridPanes have textfields and below there is a Button like this: User can write any number in GridPane A's dynamically created TextFields like this: What I want is when user will press Submit button program should calculate sum of values present in each row and then divide each row calculated sum with whole GridPane's TextFields sum and display the result in second GridPane's

Can't run javafx JAR outside Netbeans

可紊 提交于 2019-12-11 08:13:45
问题 I have a problem here with my javafx application jar, generated by Netbeans. Actually everything is running pretty well IF I am running inside Netbeans. However when I use the command line and try to run the jar of my application which was previously created by Netbeans, using the command: java -jar SequenceAlign.jar I got a LOT OF errors in my terminal. The error are the following: java.lang.NullPointerException file:/Users/tsukanomon/NetBeansProjects/SequenceAlign/dist/SequenceAlign.jar!

Displaying Pdf in Javafx using PDFJS library in Webview

≡放荡痞女 提交于 2019-12-11 07:53:31
问题 My goal is to display pdf documents in my JavaFX application. After researching I came across Mozilla's PDFJS library and found it pretty useful. What I'm doing is reading PDF file as a byte array from JAVA and calling the js code in Web view. Here is the code. JAVA CODE byte[] data = Files.readAllBytes(Paths.get("D:\\test\\test.pdf")); String base64 = Base64.getEncoder().encodeToString(data); btn.setOnMouseClicked(e -> { String js = "openFileFromBase64('" + base64 + "')"; engine

Handle Button click event from Table view

帅比萌擦擦* 提交于 2019-12-11 07:44:01
问题 I have two columns, one is Status which is the one that I click and the other is Approved By which should update after the Button action event. I was try setOnAction by getTableView().getSelectionModel().getSelectedItem().setApprovedby("User"); But it doesn't work. Please help me how to display text into Approved By column after the Button same row action event. It look like as below // Here is button cell code to setCellFactory for Status column public class Buttoncell implements Callback

How to select a 2D node in a 3D scene?

痞子三分冷 提交于 2019-12-11 07:32:58
问题 Here is my code. You can copy-paste and follow what I write bellow to see the problem yourself. public class MyApp extends Application { @Override public void start(Stage stage) throws Exception { Scene scene = new Scene(new MyView(), 100, 150); stage.setScene(scene); stage.show(); } private class MyView extends BorderPane { MyView() { GridPane board = new GridPane(); int size = 3; for (int i = 0; i < size*size; i++) { BorderPane pane = new BorderPane(); pane.setMinSize(30, 30); pane

JavaFX ObservableList remove element in listener throws exception

旧时模样 提交于 2019-12-11 07:23:57
问题 When I attach listener to observable list and in that listener I try to remove some element, in some cases it passes and in some cases it crashes. Scenario: Item is removed from a list. It triggers listener, and in that listener I try to delete another item. If in listener I try to remove element that is not just next to initially removed, it works OK. If in listener I try to remove element that is JUST NEXT to initially removed, it crashes with UnsupportedOperationException!!! Did anybody

JavaFx: Bind number bidirectional with add/multiply/

心已入冬 提交于 2019-12-11 06:47:48
问题 I want to bind two DoubleProperty bidirectional but not really 1:1, but for example in 1:1.2 proportion. I need something like: DoubleProperty x; DoubleProperty y; x.bindBidirectional(y.multiply(1.2)); So every time the value of x is set, the y value should be x*1.2 and every time the y value is set the x should be y/1.2 How can I do it? 回答1: Afaik there is nothing already in existance so you need to inplement something like this yourself. public abstract class BidirectionalBinding<S, T> {

JavaFx: How to apply validation on two GridPanes nodes simultaneously?

大憨熊 提交于 2019-12-11 06:34:59
问题 I'm creating an application using Javafx in which in which I'm creating two different GridPanes say GridPane A and GridPane B. In GridPane A I've TextFields and GridPane B I've TextFields, Checkboxes and DatePickers, all the nodes I'm creating at run time. Under both of the GridPanes A and B I've a button like this: What I want is to disable the button until both the entries of both GridPane A and GridPane B. I'm able on achieve it but only on GridPane A like this First by checking if all the

Listening on system clipboard using JavaFx

岁酱吖の 提交于 2019-12-11 06:28:50
问题 As stated in the answer to this question, one can setup a Timeline to check whether there is a change in the system clipboard: Set and use variables outside timeline in javafx 8 But is there a better way? For example, an event listener? I have searched JavaFx 8 doc and didn't find anything obviously helpful. Solutions using JavaFx is preferred, but all answers are welcome. 回答1: import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.input.Clipboard; import javafx