import javafx.application.Application; 
import javafx.beans.property.SimpleStringProperty; 
import javafx.collections.FXCollections; 
import javafx.collections.ObservableList; 
import javafx.scene.Scene; 
import javafx.scene.control.Button; 
import javafx.scene.control.TableColumn; 
import javafx.scene.control.TableView; 
import javafx.scene.layout.VBox; 
import javafx.stage.Stage; 

public class JavaFxTableBug extends Application { 
    private TableView<SimpleStringProperty> table = new TableView<>(); 
    private Button reverseButton = new Button("Reverse"); 

    @Override 
    public void start(Stage primaryStage) throws Exception { 
        table.setMaxHeight(100); 

        TableColumn<SimpleStringProperty, String> column = new TableColumn<>(); 
        column.setCellValueFactory(x -> x.getValue()); 
        table.getColumns().add(column); 

        for (int i = 0; i < 5; ++i) { 
            table.getItems().add(new SimpleStringProperty("Click on the text")); 
        } 

        reverseButton.setOnAction(unused -> { 
            ObservableList<SimpleStringProperty> tmp = FXCollections.observableArrayList(table.getItems()); 
            FXCollections.reverse(tmp); 
            table.getItems().setAll(tmp); 
        }); 

        primaryStage.setScene(new Scene( 
                new VBox(reverseButton, table) 
        )); 
        primaryStage.show(); 
    } 

    public static void main(String[] args) { 
        Application.launch(args); 
    } 
} 