The selectionModel, as its name implies, manages the selection in the table. If you set it to null, it's no surprise to me that you then get a NullPointerException when you try to select something.
I'm not sure what you are trying to achieve here. Do you want to disable selection entirely? If so, there's no easy way to do that, though see Disable selection in ListView for a solution (that's for a list view, but should work for a TableView too).
I thought your original requirement was that you wanted to be able to have a thread adding items to the table at the rate of 50 items/second while still being able to scroll and select, though. I'm not sure how turning off selection helps.
Did my code not achieve what you were looking for? For me, I was able to have it add items at four times the rate you needed, and remained perfectly responsive until there were enough items it started running out of heap space.
You mentioned deleting items. How are you wanting to do that? User selects and then deletes certain items (would be hard as the contents of the table are constantly changing)? Or is this an automated thing running from another background thread? Or something else entirely?
Sorry for bad formatting I don how to put code in this forum
Select "Use advanced editor" in the top right of your editor. Paste and select your code. Press the >> button, choose "Syntax Highlighting" and then the appropriate language.
I want to be able to select rows (not cell). (I know cell selection is false by default but there is something happening internally as I mentioned earlier which is taking most of the time and by setting selection model to be null those events are avoided but then row selection is also not there)
I was just saying that with the little modification I supplied I get faster speed, so is there any workaround where I can select rows and can have similar speed.
Delete is not that much required....
It is mainly for testing purpose now like how many rows I am able to delete in a minute without affecting my gui interaction.......
So it can be like selecting a random index and deleting it..... I know I can use ObservableList.remove(int index)