Java swing的文件浏览器组件 [英] File browser component for Java swing

查看:466
本文介绍了Java swing的文件浏览器组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人遇到了完全可定制(与所有标准LnF兼容)的Java Swing快速文件浏览器组件?

Has anyone come across a fully customizable (compatible with all standard LnF), fast file browser component for Java Swing ?

在设计UI时,我应该能够将此组件放置到Netbeans UI调色板中并拖放到任何JPanel中.它还应支持目录,单个文件,多个文件选择以及文件类型过滤. 因为我在诸如jEdit等应用程序中已经看到了这一点,所以一定有一些东西.

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.

请注意,我并不是在询问类似JFileChooser的对话框,而是询问类似浏览器/浏览器/树状视图的组件.

Note that I am not asking about a dialog box like JFileChooser instead a browser/explorer/tree-view like component.

推荐答案

这是在JPanel中构建的相对简单的文件系统浏览器:

Here's a relatively simple file system browser built in a JPanel:

以下是文件浏览器的一些更复杂的示例,其中包含图标,弹出菜单和工具提示.
这些都内置在JFrame:

Here are a few more complex examples of a file browser with icons, popup menus, and tooltips.
These are all built in a JFrame:

  • File Tree with Icons
  • File Tree with Popup Menu
  • File Tree with Tooltips

这些示例可能不像您想要的那样可定制,但是它们非常不错 添加新功能的起点.

These examples probably aren't as customizable as you may want, but they're a pretty good starting point for adding new functionality.

为进一步阅读, Swing,第二版(第17章)逐步实施JTree组件,用于浏览文件系统,其中包括延迟加载,自定义渲染,弹出菜单和工具提示.
如果您只想查看来源,可以在此处一个>.

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.

您可能还想看看 FileBro .也许您可以使用它,或者至少借用实现细节.

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.

这篇关于Java swing的文件浏览器组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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