javafx-8

How to make an animation with CSS in JavaFX?

笑着哭i 提交于 2020-01-09 10:21:08
问题 I want to change the style of Node by changing its style class. Button button = new Button(); button.getStyleClass().add("class1") button.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent mouseEvent) { button.getStyleClass().add("class2"); } }); Is it possible to change the style gradually, for making something like a transition? 回答1: Is it possible to change style gradually, for example make some transition? Yes. You will need to use setStyle rather

How to listen resize event of Stage in JavaFX?

风格不统一 提交于 2020-01-09 07:41:04
问题 I want to perform some functionality on resize event of form (or Scene or Stage whatever it is). But how can I detect resize event of form in JavaFX? 回答1: You can listen to the changes of the widthProperty and the heightProperty of the Stage : stage.widthProperty().addListener((obs, oldVal, newVal) -> { // Do whatever you want }); stage.heightProperty().addListener((obs, oldVal, newVal) -> { // Do whatever you want }); Note: To listen to both width and height changes, the same listener can be

How to enable commit on focusLost for TableView/TreeTableView?

帅比萌擦擦* 提交于 2020-01-08 14:40:11
问题 Is there any simple approach to let the TreeTableView (or TableView) try to commit values on focus lost? Unfortunatly I didn't succed with any default-implementations of javafx TableCellFactories, which is why I tried my own TreeTableCell implementations and also some different tableCell implementations like the one from Graham Smith, which seemed the most straight forward, since it already implemented a hook for focus lost, but nevertheless the value is never committed and the userchanges

How to enable commit on focusLost for TableView/TreeTableView?

Deadly 提交于 2020-01-08 14:36:33
问题 Is there any simple approach to let the TreeTableView (or TableView) try to commit values on focus lost? Unfortunatly I didn't succed with any default-implementations of javafx TableCellFactories, which is why I tried my own TreeTableCell implementations and also some different tableCell implementations like the one from Graham Smith, which seemed the most straight forward, since it already implemented a hook for focus lost, but nevertheless the value is never committed and the userchanges

How to draw 10000 circles in Random locations using JavaFX?

倾然丶 夕夏残阳落幕 提交于 2020-01-07 17:47:39
问题 I'm trying to draw 10,000 circles in JavaFX but it seems like its not working and I'm not even able to draw a single circle. Actually it trows me an error: This is the code that I currently have: public class RandomCircles extends Application { private Random randomNumbers; private int count; private final double MAX_X = 600; private final double MAX_Y = 300; private final int FINAL_CIRCLES = 10000; public void start(Stage primaryStage){ Circle initCircle = new Circle(); initCircle.setStroke

How to draw 10000 circles in Random locations using JavaFX?

本秂侑毒 提交于 2020-01-07 17:47:05
问题 I'm trying to draw 10,000 circles in JavaFX but it seems like its not working and I'm not even able to draw a single circle. Actually it trows me an error: This is the code that I currently have: public class RandomCircles extends Application { private Random randomNumbers; private int count; private final double MAX_X = 600; private final double MAX_Y = 300; private final int FINAL_CIRCLES = 10000; public void start(Stage primaryStage){ Circle initCircle = new Circle(); initCircle.setStroke

How to draw 10000 circles in Random locations using JavaFX?

梦想的初衷 提交于 2020-01-07 17:47:04
问题 I'm trying to draw 10,000 circles in JavaFX but it seems like its not working and I'm not even able to draw a single circle. Actually it trows me an error: This is the code that I currently have: public class RandomCircles extends Application { private Random randomNumbers; private int count; private final double MAX_X = 600; private final double MAX_Y = 300; private final int FINAL_CIRCLES = 10000; public void start(Stage primaryStage){ Circle initCircle = new Circle(); initCircle.setStroke

Is there a way to change the built-in controlfx notification popup color?

 ̄綄美尐妖づ 提交于 2020-01-07 04:22:49
问题 [Edit] here is an exemple of use of the notification popup I'm talking about: Notifications.create().title(...).text(...).hideAfter(Duration).show(); in this case the notification popup follow the modena style (a little bit gray) if we add dark style like this: Notifications.create().darkStyle().title(...).text(...).hideAfter(Duration).show(); It's shown with dark color So I just want to know if there is a way to change these default style, I already know about the notification pane and I am

Is there a way to change the built-in controlfx notification popup color?

倾然丶 夕夏残阳落幕 提交于 2020-01-07 04:22:25
问题 [Edit] here is an exemple of use of the notification popup I'm talking about: Notifications.create().title(...).text(...).hideAfter(Duration).show(); in this case the notification popup follow the modena style (a little bit gray) if we add dark style like this: Notifications.create().darkStyle().title(...).text(...).hideAfter(Duration).show(); It's shown with dark color So I just want to know if there is a way to change these default style, I already know about the notification pane and I am

FlowPane and Positioning

喜夏-厌秋 提交于 2020-01-07 03:48:13
问题 Is it possible to use a flowpane in the following way? Have two components (img/label) aligned to the left and then multiple buttons on the right. Example: +----------------------------------------------------------------+ | +------+ +----------+ +-----+ +-----+ | | | Img | | Text... | | btn | | btn | | | +------+ +----------+ +-----+ +-----+ | +----------------------------------------------------------------+ I am adding the buttons for design / ease of use but am running into a brick wall.