【发布时间】:2015-12-08 02:39:06
【问题描述】:
在我将 java 从 8u51 升级到 8u60 之前,我的带有 javafx 3D 对象的应用程序运行良好。 升级后,UI 是上下颠倒的。 这是我使用以下测试代码得到的结果。似乎 y 轴在渲染中是反转的,但在功能上却没有。
我尝试将 -Dprism.order=sw 作为 VM 选项。这解决了测试问题, 但随后不允许渲染 javafx 3D 对象。
有谁知道如何解决这个 java/javafx 问题。我将尝试下载并安装 Java 8u51。
注意,我已阅读JavaFX Mac OS strange rendering。
import javafx.application.Application;
import javafx.scene.PerspectiveCamera;
import javafx.scene.SceneAntialiasing;
import javafx.scene.control.*;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import javafx.scene.Scene;
public class TestAppj extends Application {
public static void main(String[] args) { Application.launch(args); }
public void start(Stage primaryStage) {
primaryStage.setTitle("Test Stage");
TabPane tabbedPane = new TabPane(new Tab("Tools", new BorderPane()), new Tab("Things", new BorderPane()));
MenuBar menuBar = new MenuBar(
new Menu("File", null, new MenuItem("Open"), new MenuItem("New"), new MenuItem("Save")),
new Menu("Edit", null, new MenuItem("Cut"), new MenuItem("Copy"), new MenuItem("Paste")));
BorderPane root = new BorderPane();
root.setTop(new VBox(menuBar, new ToolBar()));
root.setCenter(tabbedPane);
Scene theScene = new Scene(root, 500, 500, true, SceneAntialiasing.BALANCED);
theScene.setCamera(new PerspectiveCamera());
primaryStage.setScene(theScene);
primaryStage.show();
}
}
【问题讨论】: