Eclipse 或 Netbeans 用于基于 Swing 的应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2717889/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse or Netbeans for Swing based application?
提问by rfgamaral
My next university project is going to be Java based. We will have to develop this with Swing and I was wondering what's the common preference for that?
我的下一个大学项目将基于 Java。我们将不得不用 Swing 来开发它,我想知道它的共同偏好是什么?
A quick glimpse through Netbeans website and I could see a powerful Swing editor, or what it looks like one; since I never used it, I don't know. As for Eclipse, I'm sure there are plugins for Swing, but are they any good? How do they compare to Netbeans?
快速浏览 Netbeans 网站,我可以看到一个强大的 Swing 编辑器,或者它的样子;因为我没用过,不知道。至于 Eclipse,我肯定有 Swing 的插件,但它们有什么用吗?它们与 Netbeans 相比如何?
The bottom line is, should I go with Netbeans or Eclipse for a Swing based project?
最重要的是,对于基于 Swing 的项目,我应该使用 Netbeans 还是 Eclipse?
回答by OscarRyz
I recommend you to use Netbeans -
我建议你使用 Netbeans -
回答by chairam
I found my own solution which, in my eyes, is the best: I use both!! It's easy. The reasion is: I really appreciate Netbeans' interface editor, but I really prefere Eclipse to work on the code. How it works: use Eclipse and Netbeans a the same time(you need enough ram). In Netbeans I use the interface editor and I neverwrite code. Your application will have a package for the interface and other packages for the loigic, so that you keep the two parts separated. In Eclipse import: swing-worker-1.1.jar and appframework-1.0.3.jar (you can find in Netbeans directories). Then you use a syncronization program (I use Beyond Compare) to import the interface package from Netbeans in the folder of your Eclipse project(use F5 to notify to Eclipse)and to keep it syncornized. In Eclispe you will only fill the handlers of the interface code(written by Netbeans) adding a small piece code that does nothing but to call the logic part of the application that is in the Eclipse only package. This way of proceed is not as complicate as it is seem, and gives to you the best of the two worlds.
我找到了我自己的解决方案,在我看来,这是最好的:我两个都用!!这很简单。原因是:我真的很欣赏 Netbeans 的界面编辑器,但我真的更喜欢 Eclipse 来处理代码。工作原理:同时使用 Eclipse 和 Netbeans(您需要足够的内存)。在 Netbeans 中,我使用界面编辑器,但我从不使用写代码。您的应用程序将有一个用于接口的包和用于逻辑的其他包,以便您将两部分分开。在 Eclipse 中导入:swing-worker-1.1.jar 和 appframework-1.0.3.jar(您可以在 Netbeans 目录中找到)。然后使用同步程序(我使用Beyond Compare)从Netbeans 导入Eclipse 项目文件夹中的接口包(使用F5 通知Eclipse)并保持同步。在 Eclispe 中,您将只填充接口代码(由 Netbeans 编写)的处理程序,添加一小段代码,该代码除了调用 Eclipse only 包中的应用程序的逻辑部分之外什么都不做。这种进行方式并不像看起来那么复杂,它为您提供了两个世界中最好的。
回答by Denis Tulskiy
If you really want to learn Swing, and especially layouts, then do not use GUI Builders. BorderLayout, BoxLayout, and enough time will build you almost any GUI you want. In this case it does not matter whether you use NetBeans or Eclipse. I personally don't like Eclipse because of the way they do auto-completion. But is's up to you. Plus, professors like to ask you to write code by hand on the exam, so you'd better know how to do that.
如果您真的想学习 Swing,尤其是布局,请不要使用 GUI Builders。BorderLayout、BoxLayout 和足够的时间几乎可以为您构建任何您想要的 GUI。在这种情况下,使用 NetBeans 还是 Eclipse 都没有关系。我个人不喜欢 Eclipse,因为它们自动完成的方式。但这取决于你。另外,教授喜欢让你在考试中手写代码,所以你最好知道怎么做。
回答by Coding District
There are a lot of questions like these. You can look around for more.
有很多这样的问题。你可以四处看看更多。
Best way to build Java Swing GUI?
回答by Nivas
If you are going to create a rather simple application, I would recommend you handcode it. Learning GridBagLayout is not difficult. And as a university student, this is the best way to go.
如果您要创建一个相当简单的应用程序,我建议您手动编写它。学习 GridBagLayout 并不难。作为一名大学生,这是最好的方式。
If you really want to go for a GUI builder, go with NetBeans. The Eclipse VE project was very good, but is kind of dead. There is also the visualswing4eclipsebut it is (IMHO) not even in stable state. Personally I have faced a lot of difficulties in building even a medium complex UI. It sometimes overwrites its own code. Also it uses a own implementation of GroupLayout and not the JDK one.
(I am a hardcore eclipse fan, but eclipse GUI editors - the free ones (I have not tried any non-free ones) are very disappointing.
如果您真的想使用 GUI 构建器,请使用 NetBeans。Eclipse VE 项目非常好,但有点死了。还有visualswing4eclipse,但它(恕我直言)甚至没有处于稳定状态。就我个人而言,即使是构建一个中等复杂的 UI,我也遇到了很多困难。它有时会覆盖自己的代码。此外,它使用自己的 GroupLayout 实现而不是 JDK 实现。
(我是 eclipse 的铁杆粉丝,但是 eclipse GUI 编辑器 - 免费的(我没有尝试过任何非免费的)非常令人失望。
回答by Débora
I recommend NetBeans IDE and it is better as it supports widely and other java related opensource technologies and other tools' plugins are available for Netbeans.
我推荐 NetBeans IDE,它更好,因为它支持广泛,并且其他 Java 相关的开源技术和其他工具的插件可用于 Netbeans。