javafx

How can I set the JavaFX Slider to format for time?

女生的网名这么多〃 提交于 2020-01-25 04:47:04
问题 I have created a Slider using JavaFX. I`m trying to set it up so that it shows time in minutes. I have been able to setup the the minutes to range from 0 - 60. My problem is my minutes are showing correctly but my seconds are between 0 - 100. How can I fix this? Here is how I created the slider <ScrollPane fx:id="RulerScroll1" hbarPolicy="NEVER" maxHeight="40" minHeight="40" pannable="true" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="2"> <Slider fx:id="Ruler1"

JavaFX Load Exception

白昼怎懂夜的黑 提交于 2020-01-25 04:26:32
问题 I'm trying to make a basic calculator application with JavaFX but I'm having trouble launching the application. This is the error I get Exception in Application start method java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java

'replacing a task' gradle deprecation warning with javafx on intellij

混江龙づ霸主 提交于 2020-01-25 00:14:05
问题 I am trying to create a project on Gradle in IntelliJ and use JavaFX on it. I added --module-path ${PATH_TO_FX} --add-modules javafx.controls,javafx.fxml as openjfx suggested and applied changes to build.gradle as they suggested. when I run I get a deprecation warning stating: Unnecessarily replacing a task that does not exist has been deprecated. This is scheduled to be removed in Gradle 6.0. Try using create() or register() directly instead. You attempted to replace a task named 'Main.main(

SetAlignment method in JavaFX

本秂侑毒 提交于 2020-01-24 22:24:29
问题 1) When I run it, all the objects placed in the TOP_CENTER as you can see in the code I tried to place the button in the BOTTOM_RIGHT and it didn't work. 2) Can a Scene include two layouts? (Two VBox -es for example). public void NewQuestion () { sum++; t=new Text("Question number: "+sum); textfield=new TextField(); pane = new VBox(); Button NextQuestion = new Button ("Next Question"); NextQuestion.setOnAction(e-> NextQuestionButtonClicked(e)); pane.getChildren().addAll(t, textfield,

JavaFX: TextArea cursor moves back to the first line on new text

て烟熏妆下的殇ゞ 提交于 2020-01-24 21:05:40
问题 I'm having a hard time with TextArea 's cursor, it keeps being set to position 0 in the first line, after adding new text to the Textarea . Problem Background I have a Textarea , when I add enough text a scroll bar appears to put the new text below the old one. Until here everything is OK, however, the cursor in the TextArea comes back to the top which becomes annoying when I have frequent insertions to the TextArea . Here is how I add the new line each time: void writeLog(String str) {

JavaFX: TextArea cursor moves back to the first line on new text

只愿长相守 提交于 2020-01-24 21:05:12
问题 I'm having a hard time with TextArea 's cursor, it keeps being set to position 0 in the first line, after adding new text to the Textarea . Problem Background I have a Textarea , when I add enough text a scroll bar appears to put the new text below the old one. Until here everything is OK, however, the cursor in the TextArea comes back to the top which becomes annoying when I have frequent insertions to the TextArea . Here is how I add the new line each time: void writeLog(String str) {

Error with package com.sun.glass.ui while learning Java Native Access

梦想的初衷 提交于 2020-01-24 19:24:38
问题 I am trying to use an Undecorated stage in a JavaFX project, stage.initStyle(StageStyle.UNDECORATED); . It is a modular Gradle project. It is also a multi-project build, though because I am working on it in IntelliJ, it might be more appropriate to refer to it as a multi-module build. I wish to be able to add regular functionality to this Undecorated stage. I have already been able to add the usual minimize, restore, and close buttons, but if a user clicks on the program's icon in the Windows

Gradle run with `--add-exports`

感情迁移 提交于 2020-01-24 18:10:28
问题 I got a java.lang.IllegalAccessError because of using a com.sun.* class in Java >9. The solution to this is to add --add-exports=javafx.base/com.sun.javafx.event=org.controlsfx.controls . I'm not sure how to add this to my build.gradle , but I put run { jvmArgs = ['--add-exports=javafx.base/com.sun.javafx.event=org.controlsfx.controls'] } into it and it didn't help. This is pretty much the issue I have. The error message is: java.lang.IllegalAccessError: class org.controlsfx.control.textfield

Regexp for prohibit entering a point after entering a point and number JavaFX

假装没事ソ 提交于 2020-01-24 15:34:11
问题 I need input consecutive integers and real numbers separated by commas, like this: 2,12.4,3 I forbid entering sequentially two commas, two points, and all other characters, except numbers, by the following expression: (?!.*[\\.,]{2,})[\\d,\\.]* But with it I can type this: 2,12.4.3 That is, after entering a point and a number, it is possible to enter once again a point, and there must be only a number or comma. I need to leave all the conditions from the previous expression, and deny entering

JavaFX on iPhone - Laggy ListView scrolling when applying shadow

风流意气都作罢 提交于 2020-01-24 13:24:09
问题 I am developing an app on iOS using JavaFXPorts. I have a Pane that holds a ListView with countries and their flags. I have noticed that ListView scrolling is laggy when I apply the dropshadow effect on the Pane. As you can see from the videos below, without the effect the scrolling is super smooth, whilst applying the effect through CSS, scrolls starts to get laggy. I would like to keep the shadow effect as it makes app more beautiful. So any suggestion is really appreciated. CSS Code I am