Java swing 的文件浏览器组件
有没有人遇到过用于 Java Swing 的完全可定制(与所有标准 LnF 兼容)的快速文件浏览器组件?
我应该能够将此组件放置到 Netbeans UI 调色板中,并在设计 UI 时拖放到任何 JPanel 中。它还应该支持目录、单个文件、多个文件选择以及文件类型过滤。 一定有什么东西,因为我在 jEdit 等应用程序中看到过这种情况。
请注意,我不是在问像 JFileChooser 这样的对话框,而是在问像浏览器/资源管理器/树视图之类的组件。
Has anyone come across a fully customizable (compatible with all standard LnF), fast file browser component for Java Swing ?
I should be able to place this component to Netbeans UI palette and drag and drop in to any JPanel while designing the UI. Also it should support directory, single file, multiple file selection along with file type filtering.
There must be something because I have seen this in applications like jEdit etc.
Note that I am not asking about a dialog box like JFileChooser instead a browser/explorer/tree-view like component.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
下面是一个在
JPanel
中构建的相对简单的文件系统浏览器:这里有一些更复杂的文件浏览器示例,带有图标、弹出菜单和工具提示。
这些都构建在
JFrame
中:这些示例可能不像您想要的那样可定制,但它们非常好
添加新功能的起点。
如需进一步阅读,Swing,第二版(第 17 章)逐步介绍了实现
JTree
组件,用于浏览文件系统,包括延迟加载、自定义渲染、弹出菜单和工具提示。如果您只想查看源代码,可以在此处。
您可能还想看看FileBro。也许您可以使用它,或者至少借用实现细节。
Here's a relatively simple file system browser built in a
JPanel
:Here are a few more complex examples of a file browser with icons, popup menus, and tooltips.
These are all built in a
JFrame
:These examples probably aren't as customizable as you may want, but they're a pretty good
starting point for adding new functionality.
For further reading, Swing, Second Edition (Chapter 17) walks through implementing a
JTree
component for browsing your file system complete with lazy loading, custom renders, popup menus, and tooltips.If you'd like to see just the source, you can get it here.
There is also the FileBro that you may want to take a look at. Perhaps you can use it, or at least borrow implementation details.
参见 DJ 项目:
http://djproject.sourceforge.net/ns/index.html
see DJ Project:
http://djproject.sourceforge.net/ns/index.html