javafx-8

a.disableProperty().bind(b.visibleProperty()) causes invalid element rendering in Java FX 10

。_饼干妹妹 提交于 2019-12-05 20:03:31
This is a regression in Java 10, refer to the bug report for further updates: JDK-8204949 Consider the following Java FX code, where b starts invisible: a.disableProperty().bind(b.visibleProperty()) If an application utilizing such code is run on Java 10 VM, then from the first time b becomes visible, a will always be rendered as if it was disabled. Of course, during the time while a is not really disabled (despite being rendered with a gray overlay), you can still interact with that element. E.g. you can edit text in input controls, click buttons/links and so on, the events get propagated

TableView exclude bottom row (total) from sorting

懵懂的女人 提交于 2019-12-05 19:59:26
I have a simple TableView (Java FX 2.0, but I suppose the problem is fairly generic) that gets the default sorting feature. However the table has a total in its last line so I would like to exclude that last line from the sorting algorithm. I found a solution for a Swing JTable that consists in creating a separate table for the total row - that would be transposable to a TableView but it seems a bit cumbersome. I have tried implementing my own Comparator but I don't think it is possible to create one that would work in both ascending & descending orders. With JavaFX 8 it is possible to define

JavaFX freezing issue

孤人 提交于 2019-12-05 19:24:26
I was messing around with the JavaFX API, and for some reason this application seems to freeze after a (seemingly) random amount of time. It is an application that makes a red-green gradient pattern, and has a kinda cool animation to go along with it. When the application is run, press the Enter key, and the animation will start. After some amount of seconds (seemingly random as I said before) it will stop updating, but the timer continues to run, and so does the loop, and the setColor method is still being called with the proper arguments, leading me to think that either the PixelWriter is

JavaFX custom Fonts

醉酒当歌 提交于 2019-12-05 18:21:51
Actually searched everywhere but any answer can't help me, sohere's the problem: I want to add a custom font to my buttons. I already tried to write a css java class and a lot of other solutions, but nothing helped my. /code deleted/ I'd be so glad if anyone could help me! Update: I tried this: package view; import ... public class SceneStyle { ImageView header = new ImageView("/view/images/header.jpg"); ImageView chatImg = new ImageView("/view/images/chat_win.jpg"); //Layout Style //public String font1 = "Impact"; //public String font2 = "Comic Sans MS"; public static String color1 = "#00adf0

JavaFX buttons with same size

蹲街弑〆低调 提交于 2019-12-05 17:39:03
问题 I have these buttons with different size: Image How I can make all buttons with same with size? 回答1: It depends on layout where the button is located. For example, if you add all the buttons into GridPane or BorderPane, you have to specify each button width to correspond to certain variable. In the following example I wrap all buttons inside VBox, set VBox preference width and tie up all buttons minimum width to it: VBox vBox = new VBox(); vBox.setPrefWidth(100); Button btn1 = new Button(

Java FX Filter table view

落花浮王杯 提交于 2019-12-05 17:24:53
I'm trying to use a text field to filter through a table view, I want a text field (txtSearch) to search for the 'nhs number', 'first name', 'last name' and 'triage category'. I've tried implementing various solutions online and had no luck, I'm still new to all this so apologies if this was asked poorly. any help would be greatly appreciated, my code is below. public class QueueTabPageController implements Initializable { @FXML private TableView<Patient> tableView; @FXML private TableColumn<Patient, String> NHSNumberColumn; @FXML private TableColumn<Patient, String> firstNameColumn; @FXML

JavaFX default focused button in Alert Dialog

谁说我不能喝 提交于 2019-12-05 15:55:44
问题 Since jdk 8u40, I'm using the new javafx.scene.control.Alert API to display a confirmation dialog. In the example below, "Yes" button is focused by default instead of "No" button: public boolean showConfirmDialog(String title, String header, String content, AlertType alertType) { final Alert alert = new Alert(alertType); alert.setTitle(title); alert.setHeaderText(header); alert.setContentText(content); alert.getButtonTypes().clear(); alert.getButtonTypes().addAll(ButtonType.YES, ButtonType.NO

Set Bar Chart column width size

喜夏-厌秋 提交于 2019-12-05 15:41:04
Is there a way to set JavaFX Bar Chart column width size? import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.chart.BarChart; import javafx.scene.chart.CategoryAxis; import javafx.scene.chart.NumberAxis; import javafx.scene.chart.XYChart; import javafx.stage.Stage; public class BarChartSample extends Application { final static String austria = "Austria"; final static String brazil = "Brazil"; final static String france = "France"; final static String italy = "Italy"; final static String usa = "USA"; @Override public void start(Stage stage) { stage.setTitle(

How to convert a MeshView to a CSG object using JCSG library in JavaFX

落花浮王杯 提交于 2019-12-05 15:01:15
I'm using the JCSG library for JavaFX. I have some MeshView objects that I want to convert them into CSG objects, is there a way to achieve this? The easiest way to combine a javafx.scene.shape.Mesh object with a CSG one, providing you have a TriangleMesh is converting the triangular faces to polygons ( eu.mihosoft.vrl.v3d.Polygon ). Once you have a CSG object you can perform the regular operations on it, and then you can export it back to a MeshView for instance. The problem with primitive shapes ( Box , Sphere , ...) is that you don't have access to their TriangleMesh . So you can go to F(X

Remove insets in JavaFX TitledPane with CSS not working

帅比萌擦擦* 提交于 2019-12-05 12:55:42
Based on a solution of James_D ( How to set/remove insets in JavaFX TitledPane ) that I've tried, it seems that removing insets from a JavaFX TitledPane through CSS does not work? It does update correctly in Scene Builder, but at runtime the insets remain unchanged. Even Scenic View 8.0 reports a padding of 9.6. FXML example: <?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" stylesheets="