javafx-8

javafx how to transfer variable values from one controller to another [duplicate]

 ̄綄美尐妖づ 提交于 2019-12-11 11:16:31
问题 This question already has answers here : Passing Parameters JavaFX FXML (11 answers) Closed 5 years ago . i am new to javafx and i want to transfer variable values from one controller to another and i have no idea how to do this. so please help me. for example: i want to display username from first login window to second dashboard window so what should i do to save userid in one variable and send it to second window and display there in a label . code test: import java.net.URL; import java

Add two button in one column and get the click row value javafx

北慕城南 提交于 2019-12-11 10:56:55
问题 I am trying to implement two button in one column in table view in javafx . I, am able to implement one button in one column but not able to add two button in one column . I got some idea from this link How to add button in JavaFX table view Add a button to a cells in a TableView (JAVAFX) How to add two buttons in a TableColumn of TableView JavaFX I have use the idea in the link above. However, the code is not working for me. TableColumn<Student, String> firstCol = new TableColumn<Student,

Add progressbar in TreeTableView (returning Double value to Observable<Double>)

这一生的挚爱 提交于 2019-12-11 10:53:34
问题 I am experimenting with JavaFX and I am trying to add a progress bar in tree table. Is there a way to link the values of salary to progress bar. My Code is modified version of Oracle's TreeTableView Example: public class TreeTableViewSample extends Application implements Runnable { List<Employee> employees = Arrays.<Employee>asList( new Employee("Ethan Williams", 30.0), new Employee("Emma Jones", 10.0), new Employee("Michael Brown", 70.0), new Employee("Anna Black", 50.0), new Employee(

How can I monitor the duration of printing in text java fx?

时光怂恿深爱的人放手 提交于 2019-12-11 10:41:28
问题 Is there anyway that I can monitor the time duration in javafx? Lets say it to be like this System.out.println("Printing Duration: " + duration++); 回答1: Here is how I normally time a task. This example tracks how many seconds it takes for a ProgressBar to complete. The key is starting the Timeline when the Task starts and ending the Timeline when the Task finishes. import java.util.Random; import java.util.concurrent.atomic.AtomicInteger; import javafx.animation.KeyFrame; import javafx

JavaFX - deleting row in tableview with custom textfield tablecell

我只是一个虾纸丫 提交于 2019-12-11 10:32:04
问题 I am implementing a custom editable text cell to get the TAB feature in tableview. All is working fine but when i delete a row, the editable cells below the deleted row all change the values at the same time. So typing in a cell below the deleted row will change the item for multiple cells in that column. Screenshot 1 - Tableview populated with initial values & row to be deleted is selected Screenshot 2 - Tableview after deleting selected row Screenshot 3 - The editable text cells in the rows

JavaFX TableView with two fixed-columns and last one taking available space

此生再无相见时 提交于 2019-12-11 10:19:56
问题 I'm trying to make a simple 3-column TableView: One icon column containing a fixed size icon. This column must not be resizable, and must have a fixed size. One text column with a predefined prefered size, which can be resized if needed. One last column taking all available space. Unfortunatly, this simple use case seems to be really complicated with Java FX 8. I tried the following, which should work according to my understanding of the documentation: TableColumn<DebuggerItem, ImageView>

A method to algn JavaFX checkbox label text with the text on a line

情到浓时终转凉″ 提交于 2019-12-11 09:50:58
问题 I have a plain CheckBox in an FXML file on the same line as some other controls and labels in a HBox. The checkBox label text-base is about 6px units lower than ALL the other text and labels on the same line (HBox). I can manually line things up in SceneBuilder by specifying a padding-bottom value of: 6 . I wanted to put that into the CSS so all checkbox labels would be "lined-up", but everthing I've tried is ignored and doesn't show in the CSS Analyzer (too). I looked through the Checbox

huge memory consumption of javafx app on linux (not windows)

此生再无相见时 提交于 2019-12-11 09:47:13
问题 I need help to figure out what is the problem with my current setup, cause it seems that when I fire a javafx application, looking at the activity monitor I see memory growing very rapidly and never shrinking. My system is: Kubuntu wili, jdk 8u66 64 bit, hp envy laptop with 8 gigs of ram. My test is: launch Ensemble8 sample application from oracle this way: java -jar -XX:+UseG1GC -Dprism.verbose=true Ensemble8.jar where first option is supposed to help the jvm releasing memory to the system,

Inject bridge-code in JavaFX WebView before page-load?

廉价感情. 提交于 2019-12-11 09:35:22
问题 I want to load some content or page in a JavaFX WebView and offer a Bridge object to Java so the content of the page can do calls into java. The basic concept of how to do this is described here: https://blogs.oracle.com/javafx/entry/communicating_between_javascript_and_javafx Now my question is: When is a good time inject the bridge-object into the WebView so it is available as soon as possible. One option would be after page load as described here: https://stackoverflow.com/a/17612361

fireEvent from Custom class

我们两清 提交于 2019-12-11 09:19:57
问题 I have the following class ProtokollEvent public class ProtokollEvent extends Event { //variable holds all devices in given protokoll private ObservableList<Device> devicesList; //variable holds SaveResult private SaveResult result; //final ProtokollEvents public static final EventType<ProtokollEvent> PROTOKOLL_SAVE = new EventType(ANY, "PROTOKOLL_SAVE"); public static final EventType<ProtokollEvent> PROTOKOLL_SAVE_DONE = new EventType(ANY, "PROTOKOLL_SAVE_DONE"); public static final