Java - FXML,CSS

标签 java css scrollbar fxml

一段时间以来,我一直在尝试使用 CSS 来设置滚动条的样式。在一些帮助下,我设法到达某个地方,但下面的这个小白框不想消失。你如何摆脱它? "/image/ZGKPb.png "

我的CSS代码

.mylistview{
-fx-background-color:"#34495e";
}

/* The main scrollbar CSS class of ListView */
.mylistview .scroll-bar:horizontal ,
.mylistview  .scroll-bar:vertical{
-fx-background-color:"#34495e";

}

/* The increment and decrement button CSS class of scrollbar */
.mylistview .increment-button ,.mylistview .decrement-button {
-fx-opacity: 0;
-fx-background-color:"#34495e";
}

.mylistview .decrement-button {
-fx-opacity: 0;
-fx-background-color:"#34495e";
}

/* The main scrollbar **track** CSS class  */
.mylistview .scroll-bar:horizontal .track ,
.mylistview .scroll-bar:vertical .track{
 -fx-background-color: "#34495e";

}

.mylistview .scroll-bar:horizontal .thumb,
.mylistview .scroll-bar:vertical .thumb {
-fx-background-color:"#2c3e50";
-fx-background-radius: 10em;
}

我的 Fxml 代码

<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.VBox?>

<?import javafx.scene.control.ScrollPane?>
<GridPane fx:controller="sample.Controller"
      xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10"      vgap="10"
      stylesheets="/main.css">

<Label fx:id="studentlist">Student List</Label>

<ScrollPane styleClass="mylistview">
<VBox fx:id="box">
    <children>
   <Label>Michael</Label>
   <Label>George</Label>
    </children>
</VBox>
</ScrollPane>
</GridPane>

最佳答案

我一直在寻找。它被称为 Angular 。

http://www.guigarage.com/2015/11/styling-a-javafx-scrollbar/

关于Java - FXML,CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47438099/

相关文章:

Java 相当于 C 的 "ispunct()"

html - 表单的 CSS 气泡错误框

html - 响应式表重新排序

javascript - 如何在 <td> 表列中显示 javascript 标签

html - 移动方向(横向)滚动条 HTML5/Responsive

java - 更改 Android TableLayout 列跨度

java - JFrame 类在 Main 中不起作用

java - 如何在 Android 的菜单选项中添加带有文本的图像?

html - OSX Lion 上的流血滚动条

delphi - 如何在Delphi中捕获DBGrid中的滚动事件