Java - FXML,CSS

Java - FXML,CSS

一段时间以来,我一直在尝试使用 css 来设计这个滚动条的样式。在一些帮助下,我设法到达某个地方,但下面的这个小白框不想消失。你如何摆脱它? “https://i.stack.imgur.com/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>

我一直在寻找。叫做角

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