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
trashgod
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