3
嗨,你能帮助我如何做表格的轮廓。我希望表中的所有行都有轮廓。感谢您的帮助。我的表是这样的:表格的JavaFX表格轮廓
TableColumn busNumberCol = new TableColumn("Linia");
busNumberCol.setCellValueFactory(
new PropertyValueFactory<>("busNumber"));
busNumberCol.setPrefWidth(tb.getPrefWidth()/5);
TableColumn courseCol = new TableColumn("Kierunek");
courseCol.setCellValueFactory(
new PropertyValueFactory<>("nameBusStpo"));
courseCol.setPrefWidth((tb.getPrefWidth()-tb.getPrefWidth()/5)/2-1);
TableColumn departureCol = new TableColumn("Odjazd");
departureCol.setPrefWidth((tb.getPrefWidth()-tb.getPrefWidth()/5)/2-1);
departureCol.setCellValueFactory(
new PropertyValueFactory<>("busTimetable"));
table.setPrefHeight(tb.getPrefHeight());
table.setStyle("-fx-background-color: orange");
table.setPrefWidth(tb.getPrefWidth());
table.setItems(list);
table.getColumns().addAll(busNumberCol, courseCol, departureCol);
table.setPlaceholder(new Label(""));
此类选择添加到您的样式表:'。表行细胞{-fx背景色:蓝色,-fx -背景; }'。结果应该是水平的蓝线。 – DVarga