为 Java 桌面应用程序设置 IDE(eclipse)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24033818/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 09:49:12  来源:igfitidea点击:

setting your IDE(eclipse) for java desktop application

javaeclipseswingdesktop-application

提问by user3679701

I've an the Eclipse IDE with android sdk as I am an android developer. I want to develop a simple java desktop application consists of splash screen and a login screen which is connect to MS SQL through JDBC. Now, how will I enable my Eclipse to let me develop java desktop applications. or shall I use net beans. I have also downloaded the netbeans 8.0 but it not showing me the java desktop application. Also, I have installed and unzip the JDBC driver,there are 2 jar files sqlJDBC and sqlJDBC4. Please kindly tell me which jar file shall i use.

我有一个带有 android sdk 的 Eclipse IDE,因为我是一名 android 开发人员。我想开发一个简单的 java 桌面应用程序,它由启动画面和一个通过 JDBC 连接到 MS SQL 的登录屏幕组成。现在,我将如何启用我的 Eclipse 来让我开发 Java 桌面应用程序。或者我应该使用净豆。我还下载了 netbeans 8.0,但它没有向我显示 java 桌面应用程序。另外,我已经安装并解压了 JDBC 驱动程序,有 2 个 jar 文件 sqlJDBC 和 sqlJDBC4。请告诉我应该使用哪个 jar 文件。

采纳答案by Arijit

Eclipse IDE with android sdk have Java already installed. I use the same eclipse for my Android and swing development. Just go to File and create a new Java project. See the screenshot of my eclipse for better understanding:

带有 android sdk 的 Eclipse IDE 已经安装了 Java。我在 Android 和 Swing 开发中使用相同的 Eclipse。只需转到 File 并创建一个新的 Java 项目。看我的eclipse截图更好理解:

enter image description here

在此处输入图片说明

回答by David Yee

Since you've been using Eclipse with Android SDK, you probably have Java already installed and you don't need to worry about downloading extra libraries to use the Swing framework.

由于您一直在使用带有 Android SDK 的 Eclipse,您可能已经安装了 Java,并且您无需担心下载额外的库来使用 Swing 框架。

To start in Swing, take a look at the official Swing tutorialsto learn how to develop desktop applications. After you've learned the basics, try to incorporate JDBC drivers to connect to your SQL Server.

要开始使用 Swing,请查看官方Swing 教程以了解如何开发桌面应用程序。在您学习了基础知识后,尝试合并 JDBC 驱动程序以连接到您的 SQL Server。

You should add the sqljdbc4.jar Class 4 JDBC file to your Java Build Path to make a connection to your SQL Server.

您应该将 sqljdbc4.jar Class 4 JDBC 文件添加到您的 Java Build Path 以建立到您的 SQL Server 的连接。

回答by npinti

Since you will be building desktop applications, you will most likely need an IDE which allows you to visually build the UI. This usually makes development quicker.

由于您将构建桌面应用程序,因此您很可能需要一个 IDE,它允许您以可视化方式构建 UI。这通常会使开发更快。

That being said, unlike Netbeans, Eclipse does not come with a GUI builder out of the box. You will need to find and install a plugin which works for you (check herefor some of them, if you are using Swing).

话虽如此,但与 Netbeans 不同的是,Eclipse 并未附带开箱即用的 GUI 构建器。您需要找到并安装适合您的插件(如果您使用的是 Swing,请在此处查看其中一些插件)。

In Netbeans, you should be able to simply create a Java Application to which you add JFrames and other UI components.

在 Netbeans 中,您应该能够简单地创建一个 Java 应用程序,向其中添加 JFrame 和其他 UI 组件。

That being said, the Swing platform is giving way to the JavaFxplatform, so if you are building something from scratch, I would recommend you give this a look since it should offer a richer way to build the User Interface.

话虽如此,Swing 平台正在让位于JavaFx平台,因此如果您正在从头开始构建某些东西,我建议您看看它,因为它应该提供一种更丰富的方式来构建用户界面。