Cause TableView to not respond to mouse clicks in JavaFX 2.0

冷暖自知 提交于 2019-12-07 15:49:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!