javafx

How to get the TableRow index (JavaFx TableView)

混江龙づ霸主 提交于 2019-12-25 01:26:29
问题 I have a TableView in which I have a clients emails column. In the emails column there is a Label called emails that should get populated with emails from the database depending on the column in which the Label is on. The text is retrieved from a database and therefore, to get a specific email address, I need to get the row index, and query for that particular email with something like: "SELECT email from Clients WHERE clientID = " + rowItemRecord.getClientID()); My approach so far is as

How to load a web page in a WebView by clicking on a button in other stage?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 01:21:53
问题 i'm working on a browser with JavaFX i want to load a web page in FXMLFile1 contains WebView just by clicking on Button in FXMLFile2 to show the page in FXMLFile1 i tried this code : @FXML public void tabfirst (ActionEvent ee) throws IOException { //for the FXMLFile2's button text. Socket socket = new Socket(); try { //open cursor panoo.setCursor(Cursor.WAIT); que.setCursor(Cursor.WAIT); bbb.setCursor(Cursor.WAIT); //do work WebEngine myWebEngine = web1.getEngine(); //this web view is in

JavaFx: animation / transiction

…衆ロ難τιáo~ 提交于 2019-12-25 00:38:00
问题 I have a problem adding an event and a transition to a stackpane problem with gif: Clicking it to make the transition and not killing myself I wanted to open seal only to close when clicking again And I don't know why my submenu isn't over my buttons completely my controller: package com.semeq.controllers.home; import org.springframework.stereotype.Controller; import com.jfoenix.controls.JFXButton; import javafx.animation.Animation.Status; import javafx.animation.KeyFrame; import javafx

Resize or Rotate images on JavaFX canvas

最后都变了- 提交于 2019-12-25 00:33:40
问题 I'm struggling find a way to select and then rotate or resize geometric figures drawn on a canvas (using the GraphicsContext function), this funciont should be part of an application like MS Paint. For drawing shapes I'm using a layered system of Canvas to allow Undo/Redo function. My original idea was to use the snapshot function to accomplish this operation, but I'm not really sure of how implement it and if the best method to do it. UPDATE: I'm currently working on this code public class

JavaFx buttons click in order then play

主宰稳场 提交于 2019-12-25 00:25:39
问题 I am looking to have buttons play in the order in which they are clicked. For example, if I click buttons 3, 4, and 6 I would like to then click a "play" button and this button then clicks the same pattern I clicked. 回答1: Here is a crude example of how to implement this. TimeLine and SequentialTransitions are the key. Comments are in the code. import java.util.ArrayList; import java.util.List; import javafx.animation.KeyFrame; import javafx.animation.SequentialTransition; import javafx

ScenicView Javafx java.lang.UnsatisfiedLinkError

断了今生、忘了曾经 提交于 2019-12-25 00:07:03
问题 I am trying to run ScenicView as a standalong java application. I am running java -jar ScenicView.jar But I am getting the following output java.lang.UnsatisfiedLinkError: no attach in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at org.scenicview.model.attach.AttachHandlerFactory.patchAttachLibrary(AttachHandlerFactory.java:202) at org.scenicview.model.attach

JavaFX. Displaying an image from byte[]

别来无恙 提交于 2019-12-24 23:53:55
问题 This is now solved! The solution is in the code below My initial question below I need to display an Image from pixels received as an array of bytes-one byte per pixel- into a ImageView . The image was originally in png format. private WritableImage convertByteArrayToImage(byte[] pixels, int width,int height) { int imageType= Integer.valueOf(expTime.getText()); int[] ints = new int[pixels.length]; for (int i = 0; i < pixels.length; i++) { ints[i] = (int) pixels[i] & 0xff; } BufferedImage bImg

javafx: Progress bar to show the progress of the process?

大兔子大兔子 提交于 2019-12-24 23:13:35
问题 I want to show progress bar while a functionality is running. What is the best way to show it? Basically I am building a program to send multiple mails on a single click. While sending the mail I want to show progress bar while sending the mails. 回答1: The best solution in this case is using a Task . Example: Task<Parent> yourTaskName = new Task<Parent>() { @Override public Parent call() { // DO YOUR WORK //method to set progress updateProgress(workDone, max); //method to set labeltext

Why is WebView content fading out (disappearing)?

时光总嘲笑我的痴心妄想 提交于 2019-12-24 23:02:36
问题 We are experiencing a very weird behavior that the content in the WebView will disappear when we move mouse around. It seems the stylesheet of the WebView is changed after adding same database access code. I have modified the sample application at http://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm a little bit to demonstrate this issue. The modified class has the following added code, final JDBCDataSource dataSource = new JDBCDataSource(); dataSource.setUrl("jdbc:hsqldb:file:test.db

Add up childern values and write them in parent, JavaFX

血红的双手。 提交于 2019-12-24 22:37:37
问题 I have creating this treetable Now I want to sum up th children values and show the result in the parent cell under the related column. For example for Function 7 in column 2 and row 2 I want to right 2.0, and for Function 11 column 4 row 4 right 1.0 (function 12 + function 13) Here is the code which produces the treetable. root.setExpanded(true); Set<String> combinedKeys = new HashSet<>(dc.getCombiFunc().keySet()); Set<String> funcAllKeys = new HashSet<>(dc.getSortedfuncAll().keySet());