jFileChooser作为表格中的单元格编辑器 [英] jFileChooser as cell editor in a table

查看:212
本文介绍了jFileChooser作为表格中的单元格编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置一个jFileChooser作为表的单个单元格的编辑器(不是该表的整个列,因为将使用各种其他编辑器,如comboBox等)。有任何建议或示例代码吗? (我已经在这里查看了这些示例 Oracle如何使用表格

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

推荐答案

教程方法是正确的。请参阅此示例使用未修饰的 JButton 来唤起实际的编辑器。而不是 PopupDialog ,你将使用 JFileChooser

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.

附录:要将编辑器单独应用于任何单元格,请覆盖 prepareEditor( )表示所需的行和列,如此处所述。

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

这篇关于jFileChooser作为表格中的单元格编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆