【发布时间】:2015-10-23 22:40:37
【问题描述】:
在我第一次使用 JavaFX 时,场景显示错误,我找不到原因。比如第一个基础tutorial from E(fx)clipse's page中提出如下代码:
package Aplicacion;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.effect.DropShadow;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class Prueba extends Application {
@Override
public void start(Stage primaryStage) {
BorderPane p = new BorderPane();
Text t = new Text("Hello FX");
t.setFont(Font.font("Arial", 60));
t.setEffect(new DropShadow(2,3,3, Color.RED));
p.setCenter(t);
primaryStage.setScene(new Scene(p));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
它应该显示文本“Hello FX”,但显示如下:
我的 Java 版本是 Windows 64 (Win 7) 的 8u65。
【问题讨论】:
-
它显示不正确,以及我使用其他功能完成的许多其他测试。
-
我禁用了 3D 图形加速,现在场景可以正确显示。我会将其报告为错误。非常感谢您的指导。你还没有把你的评论作为接受它的答案。
标签: javafx