#JavaFX, remove default ListView properties

1 messages · Page 1 of 1 (latest)

elfin imp
#

I am attempting to create a simple list view witha modern aestethic in javafx. I can generate niceish looking listview item but cant seem to adjust the grey/white default background as you see here.

hoary brambleBOT
#

<@&987246487241105418> please have a look, thanks.

elfin imp
#

i am not sure what element to edit for that

elfin imp
#

here is my listview fxml

<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<StackPane fx:controller="jakebball11.liveplayercount.controller.GameListController" xmlns:fx="http://javafx.com/fxml" style="-fx-background-color: #1e1e13">
    <ListView fx:id="listView" style="-fx-background-color: #1e1e1e; -fx-border-color: transparent; -fx-font-size: 16px; -fx-text-fill: white;">

    </ListView>
</StackPane>
hoary brambleBOT
# elfin imp here is my listview fxml ```fxml <?xml version="1.0" encoding="UTF-8"?> <?impo...

Detected code, here are some useful tools:

Formatted code
 <  ? xml version = "1.0"encoding = "UTF-8" ?  >  <  ? import java.lang. *  ?  >  <  ? import java.util. *  ?  >  <  ? import javafx.scene. *  ?  >  <  ? import javafx.scene.control. *  ?  >  <  ? import javafx.scene.layout. *  ?  >  < StackPane fx : controller = "jakebball11.liveplayercount.controller.GameListController"xmlns : fx = "http://javafx.com/fxml"style = "-fx-background-color: #1e1e13" >  < ListView fx : id = "listView"style = "-fx-background-color: #1e1e1e; -fx-border-color: transparent; -fx-font-size: 16px; -fx-text-fill: white;" >  <  / ListView >  <  / StackPane >
elfin imp
#

and my controller,


    @FXML
    private ListView<VBox> listView;

    public void initialize() throws IOException {
        FXMLLoader loader = new FXMLLoader(Main.class.getResource("AddGameItem.fxml"));

        VBox addGameItem = loader.load();

        listView.getItems().clear();
        listView.getItems().add(addGameItem);

        System.out.println(listView.getItems());
    }