당신은 당신의 TableView 및 변경 행 스타일 setRowFactory을 사용해야합니다. 이 약간의 예 :
tableView.setRowFactory(new Callback<TableView<Data_type>, TableRow<Data_type>>(){
//There can define some colors.
int color = 0;
String colors[] = new String[]{"red","blue","green"};
@Override
public TableRow<Data_type> call(TableView<Data_type> param) {
final TableRow<Data_type> row = new TableRow<Data_type>() {
@Override
protected void updateItem(Data_type item, boolean empty) {
super.updateItem(item, empty);
//there write your code to stylize row
if(getIndex() > -1){
String color = colors[getIndex() % 3];
setStyle("-fx-background-color: "+ color + ";");
}
}
};
return row;
}
});
결과 :

프로 팁 : 대신'-fx - 배경 - color'의'-fx - background'를 사용합니다. 이렇게하면 테두리가 올바르게 유지되고 텍스트 색상이 배경색의 밝기/어둠에 자동으로 적응할 수 있습니다. –
스크롤하면 테이블보기에서 색상이 바뀝니다. –