javafx-8

How to keep css style for only one element

房东的猫 提交于 2019-12-02 06:15:52
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().getResource("/com/root/tomaszm/Design.css").toExternalForm()); And I would like to use this style only

How to check h2 database health and corruption

倖福魔咒の 提交于 2019-12-02 06:12:46
问题 I'm using h2 database in embedded mode with JavaFX 8 desktop application and I have developed an option for the user to backup and restore the database file. In the older version of the program I have used SQLite database and checking the database file was quite simple using this command pragma integrity_check. Using that command with the h2 database always throws an exception. What is the alternative for that in the h2 database? And is there an explicit or more proper way to check the h2

JavaFX SortedList: listen the list changes and the list items updated event

﹥>﹥吖頭↗ 提交于 2019-12-02 05:57:16
Use case : an ordered ListView (or TableView) insertions are made after display updates of the keys are made after display List at startup: After adding 18: After update: As you can see nothing change! The code: public final class SortedListTest extends Application { @Override public void start( Stage stage ) throws Exception { final ObservableList<IntegerProperty> il = FXCollections.observableArrayList(); il.add( new SimpleIntegerProperty( 12 )); il.add( new SimpleIntegerProperty( 24 )); il.add( new SimpleIntegerProperty( 36 )); final Button add = new Button( "Add 18" ); final Button update =

Java FX 8, trouble setting the value of text field

不问归期 提交于 2019-12-02 05:34:25
I'm trying to populate the value of a text field in Java FX. I have the Main Class,the controller and the fxml.I have bind the fxml file with controller and the appropriate field in it. When i try to set its value, it fails. Main.java import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.layout.FlowPane; import javafx.stage.Stage; public class Main extends Application { private Stage primaryStage; private FlowPane rootLayout; @Override public void start(Stage primaryStage) { try { FXMLLoader loader = new FXMLLoader(); loader

Javafx Quadrilateral Mesh

时光总嘲笑我的痴心妄想 提交于 2019-12-02 05:24:55
问题 I need to display a quadrilateral mesh in javafx each mesh face having 4 points i have tried some triangle mesh examples from fxyz library, but not sure how does it work for quadrilaterals, Can someone help pointing to examples in javafx for quadrilateral mesh. 回答1: The 3DViewer project that is available at the OpenJFX repository, contains already a PolygonalMesh implementation, that allows any number of points per face, so any polygon can be a face. You can use them that mesh implementation

How to remove legends in javafx line chart

空扰寡人 提交于 2019-12-02 05:18:39
问题 I am trying to plot javafx bar graph using line chart. Each bar line is drawn using a vertical line drawn with two points and line symbol removed. There could be many series(Bar line) in my application but want to show only two legends only. Currently legends were shown as many series been added. Somehow i am able to show only two legends and hided others. But now problem exist with spaces used by hided legends. My current code is as below:- package graph; import javafx.application

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

心已入冬 提交于 2019-12-02 04:44:37
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, String gender, String dateOfBirth, String age, String email, String phoneNumber, String city) { this

JavaFX weird (Key)EventBehavior

最后都变了- 提交于 2019-12-02 04:41:53
So I have been experimenting with it a litle bit with javaFX and I came across some rather weird behavior which might be linked to the TableView#edit() method. I'll post a working example on the bottom of this post again, so you can see what exactually is happening on which cell (debuging included!). I'll try to explain all the behavior myself, though its way easier to see it for yourself. Basically the events are messed up when using the TableView#edit() method. 1: If you are using the contextMenu to add a new item, the keyEvents for the the keys 'escape' and 'Enter' (and propably the arrow

How to get the absolute rotation of a Node in JavaFX

时光总嘲笑我的痴心妄想 提交于 2019-12-02 04:27:27
In JavaFX the rotateProperty of a Node provides me with its rotation in degree relative to its parent. Is there a way to get the absolute rotation in degree, either relative to the Scene or the Screen? For example, is there a way to calculate the angle from the Transform object of a Node i can get from getLocalToSceneTransform()? So, i did the math myself, and for my case i either get the rotation in Radians via: double xx = myNode.getLocalToSceneTransform().getMxx(); double xy = myNode.getLocalToSceneTransform().getMxy(); double angle = Math.atan2(-xy, xx); or double yx = myNode

Consuming Events with EventFilters

孤者浪人 提交于 2019-12-02 04:14:59
First, can anyone explain to me, why my MouseEvent gets consumed no matter which Alert -Option I choose? I guess it has something to do with calling an Alert within an EventFilter , but thats just not yet clear to me. public class EventFilterConsumeErrorExample extends Application { @Override public void start( final Stage primaryStage ) { final CheckBox checkBox = new CheckBox( "Check me!" ); checkBox.setOnAction( ( event ) -> { System.out.println( "onAction: " + checkBox.isSelected() ); } ); checkBox.addEventFilter( MouseEvent.MOUSE_RELEASED, ( event ) -> { System.out.println( "onFilter" );