0
私はCSSを使ってこのスクロールバーのスタイルをかなり長時間試しています。いくつかの助けを借りて私はどこかに行くことができたが、この小さな白い箱は消えたくない。どのようにそれを取り除くのですか? "https://i.stack.imgur.com/ZGKPb.png"Java - FXML、CSS
私の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>
我々は同様にHTMLが必要になりますが、これは非常に少ないに指示します。あなたのJavaタグはここにはありません。 Javascriptも使われていません。 – Flummox