Project files, GUI, NetBeans

I have always used java from the command prompt and without project files.
I use JCreator 3.5 and have all of my java source files in one directory.
When I say ?compile file?, it just retrieves all of the files it needs, very simply.
Now I think I want to use the Swing GUI and maybe the Net Beans IDE.
The tutorial uses project files in the examples,
but I have always considered them as excess baggage.
Do I need project files and what advantages do they contribute?

hillmi wrote:
I have always used java from the command prompt and without project files.
I use JCreator 3.5 and have all of my java source files in one directory.
When I say “compile file”, it just retrieves all of the files it needs, very simply.
Now I think I want to use the Swing GUI and maybe the Net Beans IDE.
The tutorial uses project files in the examples,
but I have always considered them as excess baggage.
Do I need project files and what advantages do they contribute?That depends on what you're referring to here.
If when you say "have all my java source files in one directory" you mean you don't use any packages, it's certainly possible but I'd really recommend against it. Netbeans, especially, tries to structure a project in a way that conforms to best practices for Java development.
Looking at my own Netbeans projects, I see these extra files. I'll try to give reasons if I can. Other IDEs have other files that do much of the same thing by different names:
FILES
build.xml: An ANT build file for your project, automatically generated, which lets Netbeans build the project in a standard way.
manifest.mf: This will go in your packaged JAR and gives the JVM some special options if needed.
FOLDERS
nbproject: Contains the settings for this project and is used to generate the build.xml and manifest.mf files.
src: Your source files.
Optional src/META-INF: Other files that will go into the built JAR file.
test: Testing code you want for your own development process but not to distribute.
lib: Libraries to be shipped with the JAR.
build: Temporary storage for class files built during development.
dist: Netbeans continuously builds a releasable version of your code here.
Basically, the way Netbeans handles it, you save the entire folder for yourself or to share with your team, but when you want to package it up, you just take the dist folder and give that to people.

Similar Messages

  • How to Compile and run a GUI project made in Netbeans from shell

    hi all .....
    I develpoed a java project using Netbeans .The project has GUI also (JFrame and various layout ) . The project is building and running fine through netbeans .But when I tried to compile the source files (*.java files) from shell , I failed .
    The project has two files MainFrame.java (JFrame file and this file has the public static void main method ) and helloworld.java (simple java class file). But the "src" folder created by netbeans (at project location) contains one more file named "MainFrame.form" . Moreover netbeans was using two jar files (AbsoluteLayout.jar and Swing-layout-1.0.jar .
    I tried to compile the two .java files . helloworld.java compiled successfully but the MainFrame.java didnt. I used the command :
    linux:~/netbeans projects/Network tool/src/mytool # javac -classpath ".;AbsoluteLayout.jar;Swing-layout-1.0.jar;" MainFrame.java
    The 14 errors were encountered. MOst of them were like :
    MainFrame.java:138: package org.jdesktop.layout does not exist
    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    ^
    Help, suggestion or guidance of any type is welcomed .(Keep in mind that project is running fine when done using netbeansIDE).
    waiting for reply....

    Hello,
    1. The .form file was used by Netbean's GUI builder to create the .java and is not needed for compilation.
    2..../src # javac -classpath "..." mytool/*.java
    I guess the package mytool was not coped with.
    Alternatively it is worth to use the ant build tool also used by Netbeans.
    Then you can make a jar from the class files, indicate in the manifest.mf file:
    1. the main class
    2. the library jars

  • How can I get a single jar file with NetBeans?

    How can I get a single jar file with NetBeans?
    When I create the project I get these files:
    dist/lib/libreria1.jar
    dist/lib/libreria2.jar
    dist/software.jar
    The libraries that have been imported to create the project are in separate folders:
    libreria1/libreria1.jar
    libreria2/libreria2.jar
    libreria1, libreria2, dist folders are all located inside the project folder.
    I added the following code to the build.xml:
    <target name="-post-jar">
    <jar jarfile="dist/software.jar">
    <zipfileset src="${dist.jar}" excludes="META-INF/*" />
    <zipfileset src="dist/lib/libreria1.jar" excludes="META-INF/*" />
    <zipfileset src="dist/lib/libreria2.jar" excludes="META-INF/*" />
    <manifest>
    <attribute name="Main-Class" value="pacco.classeprincipale"/>
    </manifest>
    </jar>
    </target>
    Of course there is also the project folder:
    src/pacco/classeprincipale.form
    src/pacco/classeprincipale.java
    Can you tell me what is wrong? The error message I get is as follows:
    C:...\build.xml:75: Problem creating jar: archive is not a ZIP archive BUILD FAILED (total time: 2 seconds)

    This is not a NetBeans forum, it is a JDeveloper forum. You might want to try http://forums.netbeans.org/. I also saw your other question - try looking in the New to Java forum: New To Java

  • How to import WAR files in NetBeans 6.1?

    Please any one tell me how to import WAR files in NetBeans 6.1?

    I have been using NetBeans for so many diff project but till now i didn't get chance to import WAR. But there i tried one wat as follows:
    New Project -----> Enterprise ----> package Archive ...... it shows me creating project bar at right bottom bur i cannot see any such project at project window as weel as specified location pecified at the time of creation.

  • How to include JAR file in NetBean library?

    i have downloaded JavaMail jar file and now i want to include this file into NetBean library. pls help me out.

    You can add the jar file to Netbeans as an external library by choosing 'Tools' on the menu bar and then selecting 'Library Manager'. In there you can give it a name and the path to the jar file. Once it is setup, if you go to your project properties, and click the 'Libraries' option on the left you will be able to add it. Select 'Add Library' and choose the one that you just created, it will now be part of your project.
    Alternatively, if you don't want to set it up as a library in Netbaeans, go straight to the project properties, select 'Libraries' and then select the 'Add Jar/Folder' option, now you can navigate to your jar file and add it to your project.
    For other info about JavaMail: http://java.sun.com/products/javamail/FAQ.html#install

  • Creating an exacutable jar file in netbeans

    Hey, how can i create an exacutable jar file in netbeans ?

    i guess you already have a project created, if you don't create a new java application project.
    Then you need to do the following:
    1. Set the main class. This is the class that will run first.
    for this you need to right click in the project node, select properties, then run and in the Main Class field put the main class.
    2. Set the classpath: you need to put all the libraries or resources you use in your project.
    to do that right click the libraries node, select properties, then add library and add all the libraries that your project needs
    by doing this steps netbeans will create your manifest file and the jar that will create will be executable.
    Hope this helps.
    Escobar5

  • Adding jar file in my gerareted jar file using netbean 4.0

    Hi,
    I write an application de process XML file using JDOM. I add the JDom package jar file to my project and everything work fine. But when I generate, my project jar file using netbean 4.0, my generated jar, is not working with the XML files anymore. Everything seems like it didn't include the JDOM jar file?
    Thanks for any help to fix the problem.

    I find that you can not use command-line such as java -classpath add classpath
    it can not work, I use netBeans4.0 i don't whether because of netbeans or java itself.
    you can add classpath in jar's Manifest.mf file
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.2
    Created-By: 1.5.0_01-b08 (Sun Microsystems Inc.)
    Main-Class: chat.Main
    // add this line
    Class-Path: dir\*.jar //(jar file name)
    X-COMMENT: Main-Class will be added automatically by build

  • My premiere project file size just went from 190MB to 5.61GB... and now it won't open! Anyone know how this happened?

    My premiere project file size just went from 190MB to 5.61GB... and now it won't open! Anyone know how this happened? Or how to prevent it from happening again? Thankfully I saved a backup project of the 190MB file size.

    warp stabiliser?

  • Using iMovie to save project files to external hard drive?

    I have a MacBook Pro with very limited space on the internal hard disk drive. I also have a few FireWire external hard drives.
    A friend recently gave me his Hitachi DZ-HS300A mini-DVD camcorder so I could copy footage off of it, load it into my machine, edit it and upload it (several minutes) to YouTube. He can't do this because he lives in a remote area where there is no broadband yet.
    I almost never use iMovie. I was wondering if there is a way to save the project file to an external FireWire drive so that there will be no large video files clogging up my laptop's internal hard drive. Can this be done? Is there an iMove preference I have to change?

    You should generally leave the iMovie Project file on the boot drive. The Project File is mainly a small text file with in and out points.
    The iMovie Event file is where the video assets are stored. You can store events to an external hard drive in two ways:
    1) As you import from the camera, you will see an import screen. You can select the external drive on the import screen
    2) If the event is already on your internal drive, you can click View/Events By Volume. Now you can drag and drop the event to the external drive in the Events SOurce List in iMovie.
    For your external drive to be visible to iMovie, it must be formatted HFS+ or HFS+ (journalled).

  • "Unable to open project file" Error Message

    I pulled an all-nighter (13 hours of editing) last night to create a critical project in FCE 3.5.1 on my Intel iMac running 10.4.11 then left this afternoon for a few hours and shut down my machine. Came back tonight and tried to open the project (which I saved on my Maxtor 1 TB external drive along with all of the scratch disk files). To my absolute panic, it won't open the file now with an error message that simply says, "Unable to open project file". HELP!!!! Anyone have any suggestions?!?!

    In the past I found (and reported to Apple Feedback) the same bug Steve reports here, but I should recall that the problem:
    - only appeared in PAL projects (probably not the case for kscritch) - never heard of it in NTSC
    - was consistent in FCE 3.x, not so in FCE 4
    I made tests importing .psd images with transparency into PAL projects using FCE 4, and I had various behaviours: sometimes the project worked, sometimes I couldn't open the project again (as in FCE 3), sometimes I had error messages with inconsistent behaviour (msg like "file error", but the project opened and file was there...), etc. so I decided to do without.
    Now I only import .tif or .png images when I need transparency
    Piero

  • "Unable to Open Project File" - error

    Does anyone know how to resolve an "Unable to Open Project File" - error. I accidentally shut down my computer wrong, although Final Cut wasn't open.

    Welcome to the forums.
    The project file might have gotten corrupted. Look for the AUTOSAVE VAULT (typically in the DOCUMENTS>FINAL CUT PRO DOCUMENTS folder) and open the most recent version. Copy it to your main project folder if it works.
    If not, then try trashing your prefs with FCP Rescue.
    Shane

  • Error reading project file : no protocol

    I have followed the instructions exactly as in the j2ee tutiorial ,but, when I run asant , an error occurs:
    : Error reading project file : no protocol: ../../common/targets.xml
    Urgent!

    Could you please provide a bit more detail such as which sample you are using? Also are you using the latest version of the tutorial and have you configured your build.properties in the samples/common directory?

  • Using a JAR file as a project file

    My application allows the user to create projects. Previously, a project file was simply an XML file. Now, a project file needs to also contain many images.
    I thought it would be a good idea to simply use a JAR file as my project file.
    Since I've really never really worked with JAR files and the java.util.Jar package directly, I have a few questions.
    1) Would it be better just to simply store the images as binary in the XML file? I just spent a good amount of time making the XML file very readable so I thought it would be better to keep the images separate while still having a single "project" file.
    2) Is there anything inherently wrong with the way I'm working with the JAR file in the code below?
    Simple XML file:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE project [
      <!ELEMENT project (img+)>
      <!ELEMENT img EMPTY>
      <!ATTLIST img src CDATA #REQUIRED>
    ]>
    <project>
         <img src="blah.jpg"/>
    </project>
    import java.io.*;
    import java.util.jar.JarFile;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    public class LoaderTest {
        private String imageName;
        public LoaderTest() {
            InputStream i = null;
            JarFile jf = null;
            try {
                jf = new JarFile("project.jar");
                i = jf.getInputStream(jf.getJarEntry("project.xml"));
                // Here's my simple XML parser to load the project and images
                SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
                parser.parse(new InputSource(i), new DefaultHandler() {
                    @Override
                    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
                        // Right now we only care about images
                        if (qName.equalsIgnoreCase("img")) {
                            imageName = attributes.getValue("src");
                // Load the image from the inputstream
                java.awt.image.BufferedImage img = javax.imageio.ImageIO.read(jf.getInputStream(jf.getJarEntry(imageName)));
                // Display the image in a JFrame
                javax.swing.JFrame f = new javax.swing.JFrame();
                f.setLayout(new java.awt.BorderLayout());
                f.setSize(800, 600);
                f.getContentPane().add(new javax.swing.JLabel(new javax.swing.ImageIcon(img)), java.awt.BorderLayout.CENTER);
                f.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
                f.setVisible(true);
            } catch (ParserConfigurationException ex) {
                ex.printStackTrace();
            } catch (SAXException ex) {
                ex.printStackTrace();
            } catch (IOException ex) {
                ex.printStackTrace();
            } finally {
                // Do our best to close the input streams
                if (i != null) {
                    try {
                        i.close();
                    } catch (IOException ex) {}
                if (jf != null) {
                    try {
                        jf.close();
                    } catch (IOException ex) {}
        public static void main(String[] args) {
            new LoaderTest();
    }Thank you!

    1) I also think it's much better to keep your images separate from your XML, this prevents a lot of in case you just want to read XML data
    2) What's exactly going wrong here? For the project.xml, make sure it's not inside a directory within the JAR file, or else the variable i will be null. Otherwise it looks fine..

  • I was working on a project a few days ago and now I'm not getting any audio or visuals out of it. In the project file the screen went grey. Not sure how to fix this. I'm new to iMovie, but the program seems easy to use and my Mac is new. Any help?

    I used to use Movie Maker and it would be able to handle lots of file uploads and big projects. I figure iMovie can do the same since it's newer and it's on my iMac. I was working on a project for a few months, it was working fine up until about a few days ago when the project file just stopped working. Not getting any audio or visuals and the screen went grey. I hope to not lose the project file as I've spent a lot of time on it. The project will still show up in iMovie, but it won't play. Other project files will, but this one won't for some reason. It's my first time using this program and I assumed it would be fine, but now it's causing me big problems. Anyone else run into a similar problem?

    But it is I jsut can sync, back up files, or anything becuase its stuck at this screene and wont do execute when i click either of those button

  • Need help badly. project file wont open. saying damaged file or may contain outdated elements. please help

    project file wont open. damaged file or contains outdated elements message. i believe its an XML error but i dont know how to fix it. please help

    As a happy user of the Matrox RT.X2 for many years, and later an equally happy user of a Matrox MXO2, I can say from experience that it is highly unlikely that this problem has anything to do with the Matrox hardware!
    Can you open a new blank project, and save it?
    If you cannot import your faulty project into a new project, can you import the sequence from your faulty project?
    Have you tried clearing the Media Cache, clearing your preferences, etc. - all among the techniques used to resurrect a Premiere Pro project that has gone bad???

Maybe you are looking for

  • Should i return my macbook pro 13 inch and get the baseline 13 inch air?

    i recently bought the 13 inch baseline mbp non retina. I am majoring in mechanical engineering and thsi will be my junior year so my main programs i will be using will be matlab, c++, and maple. I was wondering if i should return this and get the new

  • Create link to another part of the form

    Hi all, I have created a dynamic form that contains two work plans. Users will fill out one or the other, but not both. I want to provide links to the beginning of each work plan. I cannot reference specific page numbers as the form is dynamic and th

  • How do I move my files from my Macbook to a pc?

    How do I move my files from my MAcbook to my pc?

  • New PC - rezipped all music - most won't work. Help?

    Can anyone help? Bought a new PC (using XP Home). Had to set up new iTunes library, so re-zipped all my CDs. Now, 95% of my 2,800 songs have an exclamation mark next them and they won't work. If I try to play them from the PC, the message "Cannot be

  • "select-option" in WD for java

    Hi, In the selection-criteria I want to have a field in which the user will be able to select ranges (like in the select-options in the R/3). I know that in the webDynpro for ABAP there is a solution for this, but how can I do that in webDynpro for j