JavaFX ScrollPane边框和背景 [英] JavaFX ScrollPane border and background

查看:197
本文介绍了JavaFX ScrollPane边框和背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于ScrollPane的默认背景和边框,我遇到了一些问题. 使用这种样式可以使问题更加清楚.

I'm having some problem regarding the default background and border of the ScrollPane. Using this style made the problem clearer to see.

setStyle("-fx-background-color:blue; -fx-border-color:crimson;");

我尝试过这种风格,只有红色边框消失了,而蓝色边框给我留下了运气.

I've tried this style and got no luck only the red border gone and left me with the blue one.

setStyle("-fx-background-color:blue; -fx-background-insets:0; -fx-border-color:crimson; -fx-border-width:0; -fx-border-insets:0;");

我看了这篇旧文章 JavaFX隐藏ScrollPane灰色边框 http://docs.oracle.com/javafx/2/ui_controls/editor.htm

这行代码也不起作用

scrollPane.getStyleClass().add("noborder-scroll-pane");

谢谢

推荐答案

在当前版本的JavaFX 8中,可以使用边缘到边缘样式类完全删除边框:

In the current version of JavaFX 8, you can use the edge-to-edge style class to remove the border entirely:

<ScrollPane styleClass="edge-to-edge"/>

这篇关于JavaFX ScrollPane边框和背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆