javafx-2

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 change color of image in JavaFX

核能气质少年 提交于 2020-01-09 10:10:24
问题 I have a PNG image like this: I want to change image to something like this: How can I do this in JavaFX? 回答1: As you don't care if it is a vector shape or a bitmap, I'll just outline solutions using a bitmap here. If you actually wanted a vector shape, I believe you would need to work with vector input to get a good result. Use a ColorAdjust effect with the brightness set to minimum (-1). Cache the result for SPEED. Here is a sample which creates a shadow outline of an image: import javafx

How to change color of image in JavaFX

[亡魂溺海] 提交于 2020-01-09 10:10:09
问题 I have a PNG image like this: I want to change image to something like this: How can I do this in JavaFX? 回答1: As you don't care if it is a vector shape or a bitmap, I'll just outline solutions using a bitmap here. If you actually wanted a vector shape, I believe you would need to work with vector input to get a good result. Use a ColorAdjust effect with the brightness set to minimum (-1). Cache the result for SPEED. Here is a sample which creates a shadow outline of an image: import javafx

how to change the text of TextField in java fx 2 [closed]

為{幸葍}努か 提交于 2020-01-07 08:54:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . I have a TextField in which there is some text but I want to change that text on some event but I am getting the NullPointerException . I am using setText() method but still its not working. I am calling that function from other class . Any Help? Thanks in advance. 回答1: At beginning of the controller's class

Animated TreeView and nested Accordions

你。 提交于 2020-01-07 06:26:28
问题 I want to achive a Navigation for my application that looks like a TreeView but is animated like a TitledPane. That is, a Transition when expanding/collapsing an item for its content. What I did so far is to nest multiple Accordions like this: - TopAccordion ---- TitledPane ------- Accordion ----------TitledPane ----------TitledPane ----------TitledPane ---- TitledPane ------- Accordion ----------TitledPane ----------TitledPane ----------TitledPane etc. Unfortunately, this results in same

Applying gradient coloring with one parameter

我是研究僧i 提交于 2020-01-07 02:01:48
问题 I have differnet boxes that have a certain double parameter. This parameter should determine what color the box has. The coloring should start with one color for the double value 0.0 (perhaps blue) and should end with another color for 1.0 (perhaps red). It is more or less what is done here or Conditional coloring based on a gradient. There are different ways to define a color as stated in Oracle Docs, but it seems quiet difficult to calculate a gradient with these definitions. Does anyone

JavaFX program doesn't run in nogui command line mode

孤街浪徒 提交于 2020-01-06 21:58:50
问题 I wrote JavaFX application that can be execute in two modes. With GUI and without. If command line command has two parameters then cli selected, else gui: public static void main(String[] args) { if (args != null && args.length > 0 && args[0].equals("cli")) { String pathToProperties = args[1]; Cli cli = new Cli(pathToProperties); cli.loadPropertiesAndGenerateApk(); } else { Application.launch(args); } } In Intellij IDEA when I click Run button everything works fine. But when I build artifacts

How to plot multiple series with javafx line chart which is in array list

跟風遠走 提交于 2020-01-06 18:04:17
问题 There is no error but there is an issue with the plot am not getting the correct line chart plot, I want parameters in the x-axis and values in the y-axis but I have 3 engines as series but the series is not adding but the last series is only adding up. kindly help me with this issue. What I am trying to do is: Suppose I have n engines and m parameters of the engines, if I have 4 engines and 30 parameters then the total value will be n x m which is 4x30=120 so I want to plot engines in one

How to plot multiple series with javafx line chart which is in array list

懵懂的女人 提交于 2020-01-06 18:02:33
问题 There is no error but there is an issue with the plot am not getting the correct line chart plot, I want parameters in the x-axis and values in the y-axis but I have 3 engines as series but the series is not adding but the last series is only adding up. kindly help me with this issue. What I am trying to do is: Suppose I have n engines and m parameters of the engines, if I have 4 engines and 30 parameters then the total value will be n x m which is 4x30=120 so I want to plot engines in one

How to plot multiple series with javafx line chart which is in array list

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 18:02:13
问题 There is no error but there is an issue with the plot am not getting the correct line chart plot, I want parameters in the x-axis and values in the y-axis but I have 3 engines as series but the series is not adding but the last series is only adding up. kindly help me with this issue. What I am trying to do is: Suppose I have n engines and m parameters of the engines, if I have 4 engines and 30 parameters then the total value will be n x m which is 4x30=120 so I want to plot engines in one