How to disable column sorting in JavaFX TableView

I noticed that sorting by column headers in the JavaView TableView class is enabled by default.

In my case, I need to have a table view that does not allow sorting by any of the columns. Does anyone know how to do this?

+7
sorting javafx tableview
source share
1 answer

If you created the table columns in your own instances, for example:

TableColumn<Type, Type> column = new TableColumn<>("email"); 

then you can easily install

 column.setSortable(false); 
+16
source share

All Articles