If you want to import a jar file in NetBeans, I guess I can help you out. Using the following procedure, you can import folders as well as other projects to the project you desire. I wanted to use the log4j for using logger in my application. So I had to import a jar file (log4j-1.2.15.jar) to the project. One of my friends helped me out, infact both of us just discovered how to import. Here we go…
I always feel that a picture can convey 1000 words, so the snaps. The following is what I did:
Right click on the project to which you which to import files. Note that the project need not be set as a Main project to import packages into it.
Right Click on the Project Name !
In the window that opens, Choose Libraries in the left panel as shown below. On the right hand side of the window, I hope, you can see an option called ‘Add JAR/Folder‘, click on that.
Select Libraries from the Left Panel !
The new window that opens in familiar, I guess. Well, then Browse to the place where you have the jar file, select it and press ‘Open‘
Select the jar file you want to import
As shown below, in a tab called ‘Compile‘, you can see the files that you have added (This is the default chosen tab, so after you have pressed ‘Open‘ in the previous step you will land here). Repeat the process if you want to add more files and then press ‘OK‘.
Click on Ok after you have imported
Another windows opens and you can see that the things you have added get saved (This is what the window shows , it is just to see, nothing needs to be done).
The filed you have imported are saved
As said earlier, the same procedure can be applied to add folders and other projects. If you had noticed, those where the other option in the image 2 shown above. Problems are Welcome !