Мне нужно использовать ScrollPane, чтобы иметь возможность просматривать все сообщения, если их много.
Я добавил его, а он просто белый.
Я пытался сделать его прозрачным и все такое, но это не сработало.
Как я могу сделать мою полосу прокрутки либо прозрачной по отношению к фону BorderPane, либо каким-то образом изменить фон ScrollPane, чтобы он НЕ ВСЕГДА был БЕЛЫМ, а каким-то другим цветом или даже, возможно, изображением.
ПОМОГИТЕ СКОРЕЕ I НУЖНО СДАВАТЬ ЧЕРЕЗ НЕСКОЛЬКО ЧАСОВ
Код: Выделить всё
ScrollPane scrollPane = new ScrollPane(messageList);
// Create a new ScrollPane
scrollPane.setStyle("-fx-background-color: #00000; " + // Background color
"-fx-border-color: #000000; " + // Border color
"-fx-border-radius: 0px; " + // Border radius
"-fx-background-radius: 0px;"); // Background radius
// Set the CSS style of the ScrollPane's viewport
scrollPane.viewportBoundsProperty().addListener((observable, oldValue, newValue) -> {
scrollPane.setClip(new Rectangle(newValue.getWidth(), newValue.getHeight()));
});
scrollPane.setFitToWidth(true); // Ensures the scroll pane width fits the content
scrollPane.setFitToHeight(true);
scrollPane.setFitToWidth(true); // Ensures the scroll pane width fits the content
scrollPane.setFitToHeight(true);
scrollPane.setVisible(true);
//StackPane for INFOBOX and MESSAGE LIST
StackPane centerPane = new StackPane();
centerPane.getChildren().add(scrollPane);
centerPane.getChildren().add(infoBox);
Подробнее здесь: https://stackoverflow.com/questions/784 ... scrollpane
Мобильная версия