Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the reordering of table columns in tableView?

Trying to figure out on how can i disable the reordering of table columns in javafx 2?

like image 939
AsirC Avatar asked Jan 02 '13 04:01

AsirC


1 Answers

Here's the solution:

tblView.getColumns().addListener(new ListChangeListener() {
        @Override
        public void onChanged(Change change) {
          change.next();
          if(change.wasReplaced()) {
              tblView.getColumns().clear();
              tblView.getColumns().addAll(column1,column2...);
          }
        }
    });
like image 145
AsirC Avatar answered Oct 12 '22 03:10

AsirC