setOrientation设置为时Orientation.HORIZONTAL滑块的运动非常平滑,但setOrientation设置为时Orientation.VERTICAL运动则比较滞后。
以下是最小再现:
package org.example;
import javafx.application.Application;
import javafx.geometry.Orientation;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import org.controlsfx.control.RangeSlider;
public class App extends Application {
@Override
public void start(Stage stage) {
RangeSlider rangeSliderVertical = new RangeSlider();
rangeSliderVertical.setOrientation(Orientation.VERTICAL);
rangeSliderVertical.setMinHeight(500);
rangeSliderVertical.setMax(100);
rangeSliderVertical.setMin(0);
rangeSliderVertical.setHighValue(100);
rangeSliderVertical.setLowValue(0);
RangeSlider rangeSliderHorizontal = new RangeSlider();
rangeSliderHorizontal.setMinWidth(500);
rangeSliderHorizontal.setMax(100);
rangeSliderHorizontal.setMin(0);
rangeSliderHorizontal.setHighValue(100);
rangeSliderHorizontal.setLowValue(0);
rangeSliderHorizontal.setOrientation(Orientation.HORIZONTAL);
FlowPane vBoxWithSliders = new FlowPane();
VBox.setVgrow(vBoxWithSliders, Priority.ALWAYS);
HBox.setHgrow(vBoxWithSliders, Priority.ALWAYS);
vBoxWithSliders.setAlignment(Pos.CENTER);
vBoxWithSliders.getChildren().addAll(rangeSliderVertical, rangeSliderHorizontal);
var scene = …Run Code Online (Sandbox Code Playgroud) 我\xe2\x80\x99m 在使用 Jpackage 时遇到一些问题,包括 Controlsfx。
\n我已经使用 Maven Central 的原型在 IntelliJ 和 JavaFX 中建立了一个项目。与 IntelliJ 中的 JavaFX 配合良好。我可以使用 Maven(来自 IntelliJ)将其打包,并使用 JPackage 来制作 exe 安装程序,这也可以正常工作。I\xe2\x80\x99m 使用此命令与 JPackage:
\njpackage --input C:\\...\\target --add-modules javafx.controls --module-path C:\\...\\openjfx-20.0.1_windows-x64_bin-jmods\\javafx-jmods-20.0.1 --module-path --win-console --dest c:\\outputs --main-jar tests-1.0-SNAPSHOT.jar --main-class tests.App\nRun Code Online (Sandbox Code Playgroud)\n现在我想合并 ControlsFX,因此我从 Maven 下载 ControlsFX .JAR: https: //mvnrepository.com/artifact/org.controlsfx/controlsfx/11.1.2IntelliJ \n在 IntelliJ 中,我将其添加为模块。好吧,我想在我的项目中使用 ControlsFX。
\n现在我想制作一个 exe 安装程序(如上面没有 ControlsFX 的那样),因此我将 ControlsFX 添加到我的 JPackage 命令中:
\njpackage --input C:\\...\\target --add-modules javafx.controls,controlsfx --module-path C:\\...\\openjfx-20.0.1_windows-x64_bin-jmods\\javafx-jmods-20.0.1 --module-path C:\\..\\controlsfx --win-console --dest c:\\test --main-jar tests-1.0-SNAPSHOT.jar …Run Code Online (Sandbox Code Playgroud) 尝试每天选择最后一行。
这是我的(简化的,实际表中有更多记录)表:
+-----+-----------------------+------+
| id | datetime | temp |
+-----+-----------------------+------+
| 9 | 2017-06-05 23:55:00 | 9.5 |
| 8 | 2017-06-05 23:50:00 | 9.6 |
| 7 | 2017-06-05 23:45:00 | 9.3 |
| 6 | 2017-06-04 23:55:00 | 9.4 |
| 5 | 2017-06-04 23:50:00 | 9.2 |
| 4 | 2017-06-05 23:45:00 | 9.1 |
| 3 | 2017-06-03 23:55:00 | 9.8 |
| 2 | 2017-06-03 23:50:00 | 9.7 |
| 1 | 2017-06-03 23:45:00 …Run Code Online (Sandbox Code Playgroud)