javafx-8

ScrollPane content becomes blurry after dragging

ε祈祈猫儿з 提交于 2019-12-05 09:38:37
JavaFX 8.0 has this bug and I don't know how to solve it. Example: http://i.imgur.com/tavh6XA.png If I drag ScrollPane, its content becomes blurry, but if I drag it back, the content restores its sharpness. If I do not modify coords, the content looks pretty well. Did anybody solve this problem? Example code: @Override public void start(Stage stage) { Pane pane = new Pane(); Scene scene = new Scene(pane, 500, 500); pane.prefWidthProperty().bind(scene.widthProperty()); pane.prefHeightProperty().bind(scene.heightProperty()); ScrollPane scroll = new ScrollPane(); // Center ScrollPane scroll

Javafx Datepicker validation

坚强是说给别人听的谎言 提交于 2019-12-05 09:02:09
we tried to validate a javafx datepicker. So we use: if (fromDatePicker.getValue() == null) { sb.append("No valid from date!\n"); } else { System.out.println(fromDatePicker.getValue().toString()); if (!DateUtil .validEnglishDate(fromDatePicker.getValue().toString())) { sb.append("No valid from date. Use the format yyyy-MM-dd.\n"); } } But at the moment it's impossible to get an invalid Date with the datepicker, because all invalid date's are changed to the start value. So we asked us is it possible to get an invalid Date with the javafx datepicker? ***** EDIT ***** Example: we have the

JavaFX: How can I use correctly a ProgressIndicator in JavaFX

雨燕双飞 提交于 2019-12-05 08:49:31
I´m newbe in JavaFX. I have a problem with my JavaFX application, I need to start my ProgressIndicator (type INDETERMINATE) before a database query. This is part of my code: spinner.setVisible(true); passCripto = cripto.criptoPass(pass); MyDao dao = new MyDaoImpl(); boolean isLoginOk = dao.isUserOk(user, passCripto); boolean isStatusOk = dao.idStatusUser(user); When finished, I need to set spinner to FALSE but the spinner only is showed when database query is finished. How can I solve this ? Thanks. I do this, but not resolved: Task<Boolean> taskValidaLogin = new Task<Boolean>() { @Override

JavaFX: Use custom Node as collapse / expand branch switch for TreeView

拈花ヽ惹草 提交于 2019-12-05 08:26:26
Is it possible to replace the expand and collapse arrow of a TreeView with a custom Node / shape (instead of an image )? The -fx-shape css property of the arrows provides basic SVG shapes. .tree-cell .tree-disclosure-node .arrow { -fx-background-color: -fx-mark-color; -fx-padding: 0.333333em; /* 4 */ -fx-shape: "M 0 -4 L 8 0 L 0 4 z"; // <-- change this default triangle shape } .tree-cell:expanded .tree-disclosure-node .arrow { -fx-rotate: 90; // maybe another svg shape instead } 来源: https://stackoverflow.com/questions/20081433/javafx-use-custom-node-as-collapse-expand-branch-switch-for

ListChangeListener wasPermutated block

北战南征 提交于 2019-12-05 07:45:29
The JavaDoc for the ListChangeListener provides a template for handling changes. I don't know how to handle permutations, however. For every index, I can find out where the new index of the item is, but I don't know what to do with it. This is a bit of a puzzle that is independent of programming language. An ObservableList can only add(), remove(), set(), and also has an iterator. If I have an original list [1,2,3], and bind a list[] to it, the bound list[1,2,3] needs to match it. If the original list gets its comparator swapped so that the original list now reads [3,2,1], how do I make the

Mimicking CTRL+Click Multiple Selection in ListView using Javafx

前提是你 提交于 2019-12-05 07:07:16
I'm trying to find different ways of selecting multiple items in a ListView. The GUI will be running on a touch screen monitor, So I won't be able to CTRL+Click. From researching through various past posts, I have been able to implement Multiple Selection via keeping all the selected items in an Array and then looping through it to get the final selections. The only problem I have with my code is that compared to a CTRL +click , the selection is done smoothly, where as my code leads to a type flickering every time a new item is selected. So basically the listView clears all the selections and

How to rotate the LinearGradient in a given Shape?

自作多情 提交于 2019-12-05 06:34:39
I try to find the way to rotate the LinearGradient object nested into e.g. Rectangle object, say: Rectangle rect = new Rectangle(0, 0, 200, 200); LinearGradient lg = new LinearGradient(0, 0, 100, 0, false, CycleMethod.REPEAT, new Stop[] { new Stop(0, Color.BLACK); new Stop(0.5, Color.WHITE); new Stop(1, Color.BLACK); }); rect.setFill(lg); Now, I try to rotate this lg object, for example for 45 degrees to the left, but without rotating the whole rect . Is there any way to achieve that? The first parameters that are given to the LinearGradient constructor are the coordinates of the start- and

javafx8 TableView Multiselection returns one of the selected items as null

空扰寡人 提交于 2019-12-05 05:48:54
TableView multi selection returns one of the selected objects as null. This doesn't happen every time but happens most of the times when i try to select two rows in the table. similar to the issue defined in this question Best way of reproducing the issue is , try selecting two sequential rows . FXML : <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.control.Label?> <?import javafx.scene.control.ProgressBar?> <?import javafx.scene.control.TableColumn?> <?import javafx.scene.control.TableView?> <?import javafx.scene.control.TextField?> <?import javafx.scene.control.cell

where is the underscore in my CheckBox?

泄露秘密 提交于 2019-12-05 05:41:30
The shortest possible program to show my problem: import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.CheckBox; import javafx.scene.control.Label; import javafx.scene.layout.Priority; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class TestCheckBox extends Application { public static void main(String[] args) { launch(args); } public void start(Stage stage) { Scene scene = new Scene(new StackPane()); final VBox vbox = new VBox(); vbox.getChildren().addAll(new Label

How to set/remove insets in JavaFX TitledPane

对着背影说爱祢 提交于 2019-12-05 04:51:46
I've created a TitledPane in JavaFX with a single child component (a button) as follows: <?import java.lang.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> <children> <TitledPane animated="false" layoutX="137.0" layoutY="60.0" prefHeight="400.0" prefWidth="600.0" text="untitled" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <content> <AnchorPane minHeight="0.0"