javafx-8

Draw Circles and Curves which connect those circles

倖福魔咒の 提交于 2019-12-02 14:32:52
问题 I've a requirement to draw a few Circles and Curves connecting those circles. The circles have to be drawn in rows and columns fashion, so I guess using a GridPane would be a good choice. However, once all the circles have been drawn, how do I add curves to connect circles belonging to different columns on this GridPane? I cannot use GridPane.add(node, row, column) for curves cuz that would add the curves to GridCells, neither does GridPane have .getchildren.add() method. Is there a better

Java FX ComboBoxTableCell Show In Every Cell

Deadly 提交于 2019-12-02 14:29:38
问题 I've got a table which has a combo cell which you can select a value from for each row entry. The problem is, the drop down list only shows when the cell is being edited, and I would like it to show on every row at all times. Is this possible and if so, how? TableColumn<Product, String> actionsCol = new TableColumn<Product, String>("Exception Reason"); actionsCol.setCellValueFactory(new PropertyValueFactory("exceptionReason")); actionsCol.setCellFactory(ComboBoxTableCell.forTableColumn

JavaFX TableView custom cell rendering split menu button

流过昼夜 提交于 2019-12-02 13:44:44
i've a problem with a custom cell render in a java fx table view component. I'm able to render the split menu button, but is only rendered from second row of table. Below i put the code created to generate that image. SplitMenuButtonApp.java package com.example.splimenubtn; import java.util.ArrayList; import java.util.List; import javafx.application.Application; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.Scene; import javafx.scene.control

JavaFX PieChart Tooltip not showing despite being installed

纵饮孤独 提交于 2019-12-02 13:43:19
问题 I tried displaying a tooltip for each "slice" of a PieChart similar to this in chart.js: I found this answer basically trying to achieve the same in the same framework. It has two upvotes and the same seemed to work on other chart types judging by other (accepted) answers. However the code would not really work for me in the sense that there was no tooltip showing up. Example code showing the problem: import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.chart

javafx how to get selected row data in table view with checkbox

我与影子孤独终老i 提交于 2019-12-02 13:43:18
In this project I can't get whether the Checkbox data was selected or not in the console output. My code: import java.util.Arrays; import java.util.Iterator; import java.util.List; import javafx.application.Application; import javafx.beans.Observable; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.collections

Is there an easier (lighter) way to center text in a “zone” with JavaFX 8?

空扰寡人 提交于 2019-12-02 13:31:43
问题 So, first things first, I have achieved what I wanted, and that is, display some amount of text in the center of a "zone". Screenshot (upper right corner): Now, the problem I have is how I achieved this... This is the FXML extract for the whole tab: <Tab text="Statistics" closable="false"> <SplitPane orientation="VERTICAL" dividerPositions="0.5"> <SplitPane orientation="HORIZONTAL" dividerPositions="0.5"> <GridPane gridLinesVisible="false"> <!-- snip --> </GridPane> <!-- HERE --> <BorderPane>

How to solve type mismatch error on event onEditCommit?

℡╲_俬逩灬. 提交于 2019-12-02 13:22:09
I have used onEditCommit event in Fxml to retrive data after user edit it. FXML Code -: <TableColumn editable="true" maxWidth="5000.0" minWidth="10.0" onEditCancel="#editEnd_0" onEditStart="#editStart_0" onEditCommit="#editCommit_0" prefWidth="136.0" text="Description Of Goods" fx:id="value_0" /> Implemented onEditCommit event -: public void editCommit_0(CellEditEvent<Record,String> event) { System.out.println("Value edited: On edit new value is "+event.getNewValue()); } Error -: Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: argument type mismatch at sun

How to keep css style for only one element

限于喜欢 提交于 2019-12-02 12:59:44
问题 I have this CSS style in my application: .list-cell { -fx-background-color: null; -fx-font-size: 24px; -fx-text-fill: linear-gradient( from 0.0% 0.0% to 0.0% 50.0%, reflect, rgba(255,0,0,0.28) 0.0, rgba(102,243,255,0.58) 50.0, rgba(179,179,179,0.45) 70.0, rgba(179,179,179,0.45) 100.0); } .list-cell:hover { -fx-text-fill:linear-gradient( from 0.0% 0.0% to 100.0% 100.0%, reflect, rgb(255,255,255) 0.0, rgb(255,255,77) 100.0); } And I apply it to my program: scene.getStylesheets().add(getClass()

How to pass number to TextField JavaFX?

穿精又带淫゛_ 提交于 2019-12-02 12:57:44
问题 I am working on simple calculator, where users input two numbers in TextField and the result is displayed in result TextField . I used Double.parseDouble to get the text from input TextFields and apply the operation on it. But I am unable to pass it to third input field. I tried to cast back the double result to String but It didn't work. How can I simply pass number to TextField? double num1 = Double.parseDouble(numberInput1.getText()); double num2 = Double.parseDouble(numberInput2.getText()

TableView<T> does not display the content of ObservableList<T> objects

[亡魂溺海] 提交于 2019-12-02 12:43:47
问题 I have two almost similar custom classes for storing simple String data - they are called "Patient" and "Trace".They differ from eachother only by the number of defined fields. Constructors of both are shown below (with getVariablesNames() static method): public class Patient { String patientID; String firstName; String lastName; String gender; String dateOfBirth; String age; String email; String phoneNumber; String city; public Patient(String patientID, String firstName, String lastName,