问题
I want a JavaFX 2.0 TableView, but I don't want it to respond to mouse clicks. Of course, I can disable the control/widget but then it appears disabled.
tableview.setSelectionModel(null) gives the behavior I'd like, but the UI dumps stack traces complaining about the null. I can't catch the null.
I've been trying to create some kind of SelectionModel or TableViewSelectionModel that has some methods gutted, so it doesn't respond. I'm having a hard time extending these classes or implementing abstracts.
Ideas on disabling clicks on TableViews?
回答1:
tableView.setMouseTransparent(true)
来源:https://stackoverflow.com/questions/10521846/cause-tableview-to-not-respond-to-mouse-clicks-in-javafx-2-0