使用Java的文件资源管理器 - 如何去做? [英] File Explorer using Java - how to go about it?

查看:356
本文介绍了使用Java的文件资源管理器 - 如何去做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置使用Java创建文件资源管理器。目的是尽可能地模拟默认资源管理器的行为,无论底层操作系统是什么。

I am set to create a file explorer using Java. The aim is to emulate the behavior of the default explorer as closely as possible, whatever may be the underlying OS.

我在Java中没有进行任何GUI编程。

I have done NO GUI programming in Java.

我已经查找了Swing,SWT和JFace,我正在使用本教程开始我的项目:
http://www.ibm.com/developerworks/opensource/library/os-ecgui1/

I have looked-up Swing, SWT and JFace, and I am beginning my project with this tutorial: http://www.ibm.com/developerworks/opensource/library/os-ecgui1/

我想知道您对解决此问题的最佳方法的看法。如果您可以评论编码的复杂性,可移植性和操作系统独立性以及效率,那就太棒了。

I would like to know your opinions about the best approach to tackle this problem. If you could comment on complexity of coding, portability and OS-independence, and efficiency, it would be great.

还有什么我应该知道的吗?还有其他方法吗?

Is there anything else I should know? Do some other ways exist?

非常感谢!

感谢您的回答和回复。

Thanks for the answers and replies.

看起来我会选择Swing来实现文件浏览器。
是什么给了我毛骨悚然的想法,没有什么可以模仿默认的资源管理器视图...你能提供一些关于它的指示吗?我是否获取文件列表,获取图标,然后在屏幕上以网格方式排列它们以显示默认的资源管理器视图?

Looks like I will choose Swing to implement the file explorer. What gives me the creeps is the thought that there would be nothing to mimic the default explorer view... Could you please provide some pointers about it? Do I get list of files, get icons and then arrange them in a grid fashion on the screen to show the default explorer view?

推荐答案

最好使用Swing。对于不同的操作系统,您需要不同版本的SWT和JFace。

You would be better off using Swing. You need different versions of SWT and JFace for different operating systems.

最好的方法是从简单开始,并在您了解更多内容时添加到您拥有的内容。

The best approach is to start off simple, and add to what you have as you learn more.

为了帮助你入门,你需要一个带有两个JPanel孩子的JFrame。

To get you started, you need a JFrame with two JPanel children.

你需要添加一个JMenuBar到JFrame。 JMenu项目被添加到JMenuBar。 JMenuItem项目被添加到JMenu。

You'll need to add a JMenuBar to the JFrame. JMenu items are added to the JMenuBar. JMenuItem items are added to the JMenu.

Oracle的 Swing概述将帮助您向项目添加更多Swing组件。

Oracle's Swing Overview will help you add more Swing components to your project.

这篇关于使用Java的文件资源管理器 - 如何去做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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