jFileChooser as cell editor in a table [closed]

天大地大妈咪最大 提交于 2019-12-01 11:13:39

问题


I would like to set up a jFileChooser as an editor of a single cell of a table (not entire columns of that table as various other editors such as comboBox etc will be used). Any suggestion or sample code please? (I have already looked into these samples here How to use tables by Oracle


回答1:


The tutorial approach is correct. See this example that use an undecorated JButton to evoke the actual editor. Instead of PopupDialog, you'll use JFileChooser.

Addendum: To apply the editor to any cell(s) individually, override prepareEditor() for the desired row and column, as discussed here.



来源:https://stackoverflow.com/questions/11002953/jfilechooser-as-cell-editor-in-a-table

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