这与this几乎是同一个问题,只是略有不同。ProgressIndicator
从 Java 8u45 开始,我也开始看到控件周围的边框,但只有当我选择 Caspian 的“用户代理”样式表时才能看到它们。它看起来很糟糕,但我对 Caspian 样式表非常投入,现在不愿意更改它。这是一些演示问题的代码。显然,您必须取消注释才能看到问题。
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.control.ProgressIndicator;
import javafx.stage.Stage;
import javafx.geometry.Insets;
public class ProgressIndicatorWithBorder extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
// this.setUserAgentStylesheet(Application.STYLESHEET_CASPIAN);
ProgressIndicator pi = new ProgressIndicator();
BorderPane borderPane = new BorderPane();
borderPane.setCenter(pi);
borderPane.setMargin(pi, new Insets(12));
Scene scene = new Scene(borderPane, 640, 480);
primaryStage.setScene(scene);
primaryStage.show();
}
}