0

I'm new to Java and I wanted to create an application. I have searched all over the web for the answer to my question but although I have had views to my post on the Netbeans main page I have not had any reply. I have created a few different projects individually which each work correctly in their own right. I have used the GUI to do this as well as Photoshop which I used to create the splash screen. How do I go about merging these projects into one application?

Mozzer
  • 13
  • 3
  • Can you share more information about your project? What has Photoshop to do with Java application? Which GUI you are referring to? Do you mean IDE instead of GUI? – Akhilesh Singh Feb 03 '14 at 13:40
  • possible duplicate of [What's the best way to distribute Java applications?](http://stackoverflow.com/questions/80105/whats-the-best-way-to-distribute-java-applications) – Aaron Digulla Feb 03 '14 at 13:46
  • Hi Akhilesh, I Googled 'how to create a splash screen in Netbeans' and that is where a video showing you how to do it in Netbeans was. The guy in the video created the logo for his application in Photoshop which he used to create the splash screen. I do mean GUI in the latest version on Netbeans - 7.4 I think, which I am using there is a Graphical User Interface section where you create the screens that you want in your application and then drag things like buttons and scroll bars into place. You can then attach an action to the buttons or rename them – Mozzer Feb 03 '14 at 15:55

3 Answers3

0

It really depends on how complex your projects are and their relationships between each other. If you have simple projects, you can create a new project and create a package for the source of each of the current projects you have. The advantage of this is that you will have one project which will offer a centralized source of your code. The problem is that this might not always be an easy task, especially if you have projects of an increased complexity.

This leads to the second approach. You can have one main project which references the other projects. The will offer a more structured approach which is ideal when you have complex code, however, it can introduce other problems such as circular references.

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

The usual approach:

  1. Create one JAR file with the executable code and all resources (like your splash screen) of each individual project
  2. Copy all JARs into a single folder (usually called lib)
  3. Create a script / CMD file which locates the Java runtime, builds the classpath from all the JARs in the lib folder and then invokes the main class.

If you use Maven to build your project, you can use the assembly plugin to automate these steps.

Related articles:

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
0

Make your project as a library and through the intent you can call project main activity but make sure you define the project main activity in your home project manifest file. Use the link below for library project:

Library project

Or copy all the classes and layout.xml files into your main package and declare all activities in your manifest.

Umit Kaya
  • 5,771
  • 3
  • 38
  • 52