1

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.

user3679701
  • 45
  • 1
  • 1
  • 7

3 Answers3

0

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.

To start in Swing, take a look at the official Swing tutorials to learn how to develop desktop applications. After you've learned the basics, try to incorporate JDBC drivers to connect to your 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.

David Yee
  • 3,515
  • 25
  • 45
0

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.

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 here for some of them, if you are using Swing).

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

That being said, the Swing platform is giving way to the JavaFx platform, 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.

Community
  • 1
  • 1
npinti
  • 51,780
  • 5
  • 72
  • 96
0

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:

enter image description here

Arijit
  • 1,633
  • 2
  • 21
  • 35
  • okay, i got it now.. i have to extend the JFrame class...okay okay thanks .. and sir how you design the UI part – user3679701 Jun 04 '14 at 10:03
  • like for android we design it in xml and then using R.layout.__ use that layout in our code ... how to do it here – user3679701 Jun 04 '14 at 10:04
  • @user3679701 You can not do that with pure swing. If you want to draw UI with XML you have to use JavaFX. In swing we use Java code for building UI. Please read swing tutorials from Internet. There are a lot of tutorial are available for bigeners. Official page for this is here: http://docs.oracle.com/javase/tutorial/uiswing/ – Arijit Jun 04 '14 at 10:23
  • But always try to develop UI in native code. This is my suggestion. Also for android if you use native code to develop UI instead of using xml, your code will execute faster. – Arijit Jun 04 '14 at 10:26