Windowlistener on a main class but listening to subclasses

hi
is it possible to have a windowlistener in a main class
but listen to jframes(opened by the following method "show()") in subclasses
theres a few reasons why i want to do it this way, rather than have each subclass with its own WindowListener
1. less code to write for each class
2. i have methods inside the Main class that i want to use such as (.setCursor)
thanks for your time:)

nicchick wrote:
thanks for reply one last question
do you make reference to the subclass itself?I don't understand your question.
When you ask a question try to give as much details as possible.
The way you handle each event is up to you.

Similar Messages

  • Servlet can't run,Could not find the Main class,but how ?

    well i have made a simple servlet,but when i run it i get the following error.
    C:\jdev903_pre\jdk\bin\javaw.exe -ojvm -classpath C:\jdev903_pre\j2ee\home\oc4j.jar -Doracle.j2ee.dont.use.memory.archive=true com.evermind.server.OC4JServer -config C:\jdev903_pre\jdev\system9.0.3.988\oc4j-config\server.xml
    [Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
    [waiting for the server to complete its initialization...]
    java.lang.NoClassDefFoundError: com.evermind.server.OC4JServer
    Exception in thread main
    Process exited with exit code 1.
    kind regards
    Thanks for the very fast response,but how ?
    Can you run your servlet on OC4J standalone directly, to narrow down the problem..
    thanks,
    -Prasad

    A quick way to test would be
    - Assuming you have OC4J standalone installed
    - copy your servlet (HelloWorld.java) file into \default-web-app\WEB-INF\classes
    - compile it
    - run it using the url http://localhost:8888/servlet/HelloWorld
    -Prasad

  • Executable Jar:  Could not find the main class. Program will exit.

    I have a jar which contins the class Main.class.
    Following details are specified in the Manifest file.
    Manifest-Version: 1.0
    Main-Class: Main
    However, when I double click the jar file, I get the error...
    Could not find the main class. Program will exit.
    What could be wrong?
    Thanks in advance
    Sachin

    hi,
    i've got exactly the same problem: double clicking the archive ends with an error (can't find the main class) but working with the command line executes the file!??!
    does anyone know a solution?
    thanks

  • How to set main class in netbeans?

    i have a class with a main method that i want to set as my main class, but i dont have the source for it. how can i set it as my main class in netbeans?
    thanks!

    ya i can run in from the comand prompt, Excellent.
    and yeah your right it should be easy. It IS easy. You just did it.
    but for the life of me i cant figure it out. What can't you figure out? How to do the same thing in NetBeans?
    i dont know where else to turn.Let me suggest the NetBeans docs. I'm sure they've got something in there to tell users how to run a .class with a main() method.
    Better yet, keep doing things on the command line until you're knowledgable about NetBeans and leave the IDE alone until you know Java. Two mysteries at once is too much.
    %

  • Java can't find main class when manifest has certain JARs on it

    I recently wrote an Ant script that builds my application and jars it up, creating a manifest in the process. The manifest specifies the main class and a classpath that mentions other jars that exist in the same directory. Everything works as expected and I am able to run the program using "java -jar abc.jar".
    However, I recently started using classes in my program that come from a jar that should (according to the company I work for) reside in a central location rather than each application having its own copy. So, I changed my build script to reference those shared jars in a common location. But now when I run "java -jar abc.jar", I get a java.lang.ClassNotFoundException: com.example.Main. If I edit the jar's manifest and manually remove the new jars from the classpath, the ClassNotFoundException error goes away (although obviously that causes other problems.) Is there something about adding those new jars to the manifest classpath that would prevent Java from finding my main class? My manifest looks something like this and the last two jars (the ones with the absolute paths) are the jars that seem to be the root of the problem.
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.0
    Created-By: 1.5.0_04-b05 (Sun Microsystems Inc.)
    Main-Class: com.uprr.app.rsa.Main
    Class-Path: acegi-security-1.0.6.jar commons-codec-1.4.jar commons-htt
    pclient-3.1.jar commons-lang-2.4.jar commons-logging-1.1.1.jar common
    s-pool-1.5.4.jar dom4j-1.6.1.jar jakarta-oro-2.0.8.jar jaxen-1.1.1.ja
    r jibx-run-1.2.1.jar joda-time-1.6.jar jsr173_1.0_api.jar log4j-1.2.1
    5.jar opensaml-1.1.jar spring-2.5.2.jar stax-api-1.0.1.jar wstx-asl-3
    .2.9.jar xmf-3.0.2.jar xmlsec-1.4.1.jar C:\software\tibco\ems\clients
    \java\jms.jar C:\software\tibco\ems\clients\java\tibjms.jarAny ideas?
    Brandon

    I still don't know why giving the absolute classpath entry like that would cause Java to be unable to find the jar's main class, but I did make an interesting discovery. If I give the absolute path without the drive letter, is able to find the main class again. Something like this won't work...
    Class-Path: C:\software\tibco\ems\clients\java\tibjms.jarBut something like this will...
    Class-Path: \software\tibco\ems\clients\java\tibjms.jarBut I'd still like to know why Java doesn't accept drive letters when running on a Windows machine. After all, what if my manifest needed to reference a jar that was on a different drive, like a network drive (since this whole problem came up as a result of shared common jars that need to exist outside of the project.)

  • My program compiles but when i run it, main class cannot be found

    as you can see, my program TestMaker compiles but when i try running it i get all these errors, i have no idea what's wrong with this
    C:\Users\Student\workspace\TestMaker\src>javac TestMaker.java
    C:\Users\Student\workspace\TestMaker\src>java TestMaker 514pcp.txt
    Exception in thread "main" java.lang.NoClassDefFoundError: TestMaker
    Caused by: java.lang.ClassNotFoundException: TestMaker
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: TestMaker. Program will exit.
    C:\Users\Student\workspace\TestMaker\src>

    jgv9a wrote:
    So i try
    java -cp . TestMaker 514pcp.txt
    and get this
    C:\Users\Student\workspace\TestMaker\src>java -cp . TestMaker 514.txt
    Exception in thread "main" java.lang.NoClassDefFoundError: StdInThat means that you are using a class (StdIn), that is not on your classpath, but in some other place.
    The "-cp ." tells Java to ignore the CLASSPATH variable and just look in the current directory instead. You probably had the location of StdIn on your CLASSPATH variable.
    What you need to do in this case is to add the current directory "." to your CLASSPATH variable.
    Go [learn about the Classpath here|http://java.sun.com/javase/6/docs/technotes/tools/windows/classpath.html].

  • I already set the Main-Class:class parameter but still error... Help pls...

    I have an experimental project that starts with a main class called "mainConsole"
    I packed it using the NetBeans IDE 3.3.2 jar packager and also set the Main-Class: mainConsole parameter
    I still receive the error below when trying to execute the jar file.
    java.lang.NoClassDefFoundError: mainConsole
    Exception in thread "main"
    Can someone help me?
    Thanks in advance.

    Help me pleeeease!!

  • [Jar Executable] Could not find the main class. Progam will exit.

    Hello,
    I am a French person. Excuse me for my English who is not perfect.
    I seek to create an achievable "jar". I followed the instructions given in the url http://java.developpez.com/faq/java/?page=execution#creationJar, and on the site of Sun.
    I have today only one class which I posed in a specific repertory "Class".
    Appli
    |__Class
    |__Src
    |__META-INFThe contents of my "Manifest" is stored in repertory META-INF with the name "Commission2007.MF" and its contents are as follows:
    Manifest-Version: 1.0
    Created-By: 1.5.0 (Sun Microsystems Inc.)
    Main-Class: Commission2007
    .I've left the space line at the end of the file.
    Here the result of execution of my order "jar":
    C:\#Java Dev\2007_Commissionnements>jar cvfm Commission2007.jar META-INF/Commission2007.MF -C Class/ .
    manifest ajout�
    ajout : Class/./(entr�e = 0) (sortie = 0)(0% stock�)
    ajout : Class/./Commission2007.class(entr�e = 9060) (sortie = 4547)(49% compress�s)I controlled the assignment of the extension "jar" in "Working station = > Tools = > Files Option = > Files Type = > .jar Selection = > Advance =
    Open = > Change = >" C:\Program Files\Java\jre1.6.0\bin\javaw.exe "- gravel bank" %1 "% *". Thus not of problem on this side there!When I double click on the file "jar" lately created, I have the error message according to: "Could not find the main class. Progam will exit. " I do not understand the reason of this error. I consulted all the subjects on the treating Net of this subject but without result. I thus call upon you.
    Perhaps that the cause is in my code which however functions perfectly when I carry out it with the order: "Commission2007 java". The class "hand" is quite present to see the code below. You can find the totality of my code on the bond http://www.developpez.net/forums/showpost.php?p=1870361&postcount=74
    import �
    public class Commission2007 extends Frame implements ActionListener, WindowListener
         �
         // Construction de la class EdText
         // D�finition et affichage de la bo�te de dialogue
         Commission2007()
         �
         // D�finition d'une frame pour l'application et affichage de la
         // bo�te de dialogue
         public static void main(String args[])
              Commission2007 editer = new Commission2007();
              editer.show();
              editer.addWindowListener(editer);
    }I thank you in advance for your assistance.
    Cordially, Gilles.

    Salut,
    It has been my experience that it is never a good idea to name your .MF file anything else other than MANIFEST.MF.
    Try naming your .MF file MANIFEST.MF and rebuild your JAR.
    Bon chance.

  • Need help with custom event from Main class to an unrelated class.

    Hey guys,
    I'm new to Flash and not great with OOP.  I've made it pretty far with google and lurking, but I've been pulling my hair out on this problem for a day and everything I try throws an error or simply doesn't hit the listener.
    I'm trying to get my Main class to send a custom event to an unrelated class called BigIcon.  The rest of the code works fine, it's just the addEventListener and dispatchEvent that isn't working.
    I've put in the relevant code in below.  Let me know if anything else is needed to troubleshoot.  Thank you!
    Main.as
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        public class Main extends MovieClip
            var iconLayer_mc:MovieClip = new MovieClip();
            public function Main()
                Spin_btn.addEventListener(MouseEvent.CLICK,fl_MouseClickHandler);
                addChildAt(iconLayer_mc,0);
                placeIcons();
            function placeIcons():void
                var i:int;
                var j:int;
                for (i = 0; i < 4; i++)
                    for (j = 0; j < 5; j++)
                        //iconString_array has the names of illustrator objects that have been converted to MovieClips and are in the library.
                        var placedIcon_mc:BigIcon = new BigIcon(iconString_array[i][j],i,j);
                        iconLayer_mc.addChild(placedIcon_mc);
            function fl_MouseClickHandler(event:MouseEvent):void
                dispatchEvent(new Event("twitchupEvent",true));
    BigIcon.as
    package
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.utils.getDefinitionByName;
        public class BigIcon extends MovieClip
            private var iconImage_str:String;
            private var iconRow_int:int;
            private var iconColumn_int:int;
            public function BigIcon(iconImage_arg:String, iconRow_arg:int, iconColumn_arg:int)
                iconImage_str = iconImage_arg;
                iconRow_int = iconRow_arg;
                iconColumn_int = iconColumn_arg;
                this.addEventListener(Event.ADDED_TO_STAGE, Setup);
            function Setup(e:Event)
                this.y = iconRow_int;
                this.x = iconColumn_int;
                var ClassReference:Class = getDefinitionByName(iconImage_str) as Class;
                var thisIcon_mc:MovieClip = new ClassReference;
                this.addChild(thisIcon_mc);
                addEventListener("twitchupEvent", twitchUp);
            function twitchUp(e:Event)
                this.y +=  10;

    Ned Murphy wrote:
    You should be getting an error for the Main.as class due to missing a line to import the Event class...
    import flash.events.Event;
    My apologies, I should attempt to compile my example code before I ask for help...
    Alright, this compiles, gives me no errors, shows my 'book' and 'flowers' icons perfectly when ran, and prints 'addEventListener' to the output window as expected.  I get no errors when I press the button, 'dispatchEvent' is output (good), but the 'twitchUp' function is never called and 'EventTriggered' is never output. 
    How do I get the 'twitchUp' event to trigger?
    Main.as
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.events.*;
        public class Main extends MovieClip
            var iconLayer_mc:MovieClip = new MovieClip();
            var iconString_array:Array = new Array(2);
            public function Main()
                Spin_btn.addEventListener(MouseEvent.CLICK,fl_MouseClickHandler);
                addChildAt(iconLayer_mc,0);
                buildStringArray();
                placeIcons();
            function buildStringArray():void
                var i:int;
                var j:int;
                for (i = 0; i < 2; i++)
                    iconString_array[i] = new Array(3);
                    for (j = 0; j < 3; j++)
                        if (Math.random() > .5)
                            //'flowers' is the name of an illustrator object that has been converted to a MovieClip and is in the library
                            iconString_array[i][j] = "flowers";
                        else
                            //'book' is the name of an illustrator object that has been converted to a MovieClip and is in the library
                            iconString_array[i][j] = "book";
            function placeIcons():void
                var i:int;
                var j:int;
                for (i = 0; i < 2; i++)
                    for (j = 0; j < 3; j++)
                        //iconString_array has the names of illustrator objects that have been converted to MovieClips and are in the library.
                        var placedIcon_mc:BigIcon = new BigIcon(iconString_array[i][j],i*50,j*50);
                        iconLayer_mc.addChild(placedIcon_mc);
            function fl_MouseClickHandler(event:MouseEvent):void
                dispatchEvent(new Event("twitchupEvent",true));
                trace("dispatchEvent");
    BigIcon.as
    package
        import flash.display.MovieClip;
        import flash.events.*;
        import flash.utils.getDefinitionByName;
        public class BigIcon extends MovieClip
            private var iconImage_str:String;
            private var iconRow_int:int;
            private var iconColumn_int:int;
            public function BigIcon(iconImage_arg:String, iconRow_arg:int, iconColumn_arg:int)
                iconImage_str = iconImage_arg;
                iconRow_int = iconRow_arg;
                iconColumn_int = iconColumn_arg;
                this.addEventListener(Event.ADDED_TO_STAGE, Setup);
            function Setup(e:Event)
                this.y = iconRow_int;
                this.x = iconColumn_int;
                var ClassReference:Class = getDefinitionByName(iconImage_str) as Class;
                var thisIcon_mc:MovieClip = new ClassReference;
                this.addChild(thisIcon_mc);
                addEventListener("twitchupEvent", twitchUp);
                trace("addEventListener");
            function twitchUp(e:Event)
                this.y +=  10;
                trace("EventTriggered");
    Output:
    [SWF] Untitled-1.swf - 40457 bytes after decompression
    addEventListener
    addEventListener
    addEventListener
    addEventListener
    addEventListener
    addEventListener
    dispatchEvent
    [UnloadSWF] Untitled-1.swf
    Test Movie terminated.

  • Jar files and Main-Class attribute

    Sorry, I know there are other topics regarding this argument but none of them helped me solving my problem.
    I've tried a thousand time in every possible way, but I still can't run my application from a jar file. I've got a package called client, whose main class is called Client. The package contains a sub-package called Icons. I've put everything into a jar file and added this manifest:
    Manifest version: 1.0
    Name: client/
    Sealed: True
    Main-Class: client.Client
    But it won't work. I've tried to erase the Sealed part, I've tried "Main-Class: Client" and also "client/Client", I've tried putting into the jar the client directory and I've tried omitting it, but the answer is always the same:
    Failed to load main-class header etc.
    Can anyone help me? Please, I'm almost desperate!
    Thanks

    Here's the verbose-mode description of what I did.
    jar -cfv client.jar clientaggiunto manifesto
    aggiunta in corso di: client/(in = 0) (out= 0)(archiviato 0%)
    aggiunta in corso di: client/.nbattrs(in = 767) (out= 310)(compresso 59%)
    aggiunta in corso di: client/Client.class(in = 533) (out= 340)(compresso 36%)
    aggiunta in corso di: client/Client.java(in = 288) (out= 140)(compresso 51%)
    aggiunta in corso di: client/ClientForm$1.class(in = 691) (out= 383)(compresso 44%)
    aggiunta in corso di: client/ClientForm$10.class(in = 678) (out= 380)(compresso 43%)
    aggiunta in corso di: client/ClientForm$11.class(in = 689) (out= 385)(compresso 44%)
    aggiunta in corso di: client/ClientForm$2.class(in = 686) (out= 379)(compresso 44%)
    aggiunta in corso di: client/ClientForm$3.class(in = 686) (out= 381)(compresso 44%)
    aggiunta in corso di: client/ClientForm$4.class(in = 686) (out= 380)(compresso 44%)
    aggiunta in corso di: client/ClientForm$5.class(in = 686) (out= 383)(compresso 44%)
    aggiunta in corso di: client/ClientForm$6.class(in = 718) (out= 399)(compresso 44%)
    aggiunta in corso di: client/ClientForm$7.class(in = 718) (out= 400)(compresso 44%)
    aggiunta in corso di: client/ClientForm$8.class(in = 718) (out= 399)(compresso 44%)
    aggiunta in corso di: client/ClientForm$9.class(in = 718) (out= 398)(compresso 44%)
    aggiunta in corso di: client/ClientForm.class(in = 33070) (out= 13510)(compresso 59%)
    aggiunta in corso di: client/ClientForm.form(in = 131398) (out= 4521)(compresso96%)
    aggiunta in corso di: client/ClientForm.java(in = 73435) (out= 6863)(compresso 90%)
    aggiunta in corso di: client/Icons/(in = 0) (out= 0)(archiviato 0%)
    aggiunta in corso di: client/Icons/brick.gif(in = 1044) (out= 1049)(compresso 0%)
    aggiunta in corso di: client/Icons/corpo.gif(in = 4011) (out= 3400)(compresso 15%)
    aggiunta in corso di: client/Icons/door.gif(in = 1092) (out= 1097)(compresso 0%)
    aggiunta in corso di: client/Icons/floor.gif(in = 1102) (out= 1107)(compresso 0%)
    aggiunta in corso di: client/Icons/mappa.gif(in = 20901) (out= 20575)(compresso 1%)
    aggiunta in corso di: client/Icons/paesaggio.gif(in = 18962) (out= 18603)(compresso 1%)
    aggiunta in corso di: client/Icons/sole.gif(in = 7063) (out= 6546)(compresso 7%)
    aggiunta in corso di: client/Icons/trap.gif(in = 1062) (out= 1067)(compresso 0%)
    aggiunta in corso di: client/Icons/void.gif(in = 842) (out= 847)(compresso 0%)
    aggiunta in corso di: client/Listener.class(in = 1869) (out= 1136)(compresso 39%)
    aggiunta in corso di: client/Listener.java(in = 2296) (out= 708)(compresso 69%)
    aggiunta in corso di: client/manifesto.txt(in = 62) (out= 58)(compresso 6%)
    aggiunta in corso di: client/ScorciatoieDialog$1.class(in = 740) (out= 391)(compresso 47%)
    aggiunta in corso di: client/ScorciatoieDialog$PopupListener.class(in = 1579) (out= 773)(compresso 51%)
    aggiunta in corso di: client/ScorciatoieDialog.class(in = 3524) (out= 1638)(compresso 53%)
    aggiunta in corso di: client/ScorciatoieDialog.form(in = 8500) (out= 910)(compresso 89%)
    aggiunta in corso di: client/ScorciatoieDialog.java(in = 5676) (out= 1222)(compresso 78%)
    jar umf mainclass.txt client.jar[NOTE: mainclass.txt only contains the line "Main-Class: client.Client"]
    java -jar client.jarFailed to load Main-Class manifest attribute from
    client.jar
    I've also tried to manually create a MANIFEST.MF file that only contained the following lines:
    Manifest Version: 1.0
    Main-Class: client.Client
    guess what was the result?
    java -jar client.jarException in thread "main" java.io.IOException: invalid manifest format
    at java.util.jar.Manifest.read(Manifest.java:193)
    at java.util.jar.Manifest.<init>(Manifest.java:52)
    at java.util.jar.JarFile.getManifest(JarFile.java:158)
    >
    the same procedure with the addition of "Name: client/" before the main-class attribute generated the usual "Failed to load Main-Class manifest attribute" result. So now what?!? I'm getting crazy....

  • Forwarding events from my menubar class to main class

    I'm brand new to swing. I'm trying write an app, and wanted to encapsulate my JToolBar and JMenuBar items, so I made classes to handle each of them. Then from my "main" class I could just call a function and voila.
    However the one obvious problem is that my "main" class doesn't know when JToolBar or JMenuBar items have actions. Those classes each handle their own event listening. I was hoping (probably through magic) that I could then forward that action to the main class somehow.
    The obvious solution would be to expose the individual toolbar JButtons and JMenuItems and call addActionListener(this) on those items from the "main" class. However I'm hoping to avoid having to expose those items, probably just because I'm anal.
    One idea that I've seen but seems kind of not-very-elegant was to create an item to track the state of all things, and pass that item around. Then in my individual actionPerformed() functions I could manipulate that item so that the main class could see those changes.
    I imagine I'll have this same issue when I get into more complicated parts of my would-be application than just the menubar. Any help would be appreciated.

    OK so I can define the new actions in my main class and then in my toolbar/menubar items I just tell them to use those main class Actions? Hopefully I have as somewhat firm a grasp on this as I think I have. I'll try that out now.

  • The dreaded "could not find the Main Class, Program will exit", how?

    Hello all,
    I am trying to run my .jar file and I get this error message.
    I want to mention I googled and searched for it, without success: There is so many different explanations!
    I tried this:
    Adding some lines in a manifest.fm file...
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.0
    Created-By: 10.0-b19 (Sun Microsystems Inc.)
    X-COMMENT: Main-Class will be added automatically by build
    I have Netbeans 5.5.
    Also I noticed my "build.xml" file is empty" and my "manifest.fm" nearly empty. I have also added "project, main class" in the options...
    Here is my "build":
    {code}<?xml version="1.0" encoding="UTF-8"?>
    <!-- You may freely edit this file. See commented blocks below for -->
    <!-- some examples of how to customize the build. -->
    <!-- (If you delete it and reopen the project it will be recreated.) -->
    <project name="BetaCourseworkJava3d_Final" default="default" basedir=".">
    <description>Builds, tests, and runs the project BetaCourseworkJava3d_Final.</description>
    <import file="nbproject/build-impl.xml"/>
    <!--
    There exist several targets which are by default empty and which can be
    used for execution of your tasks. These targets are usually executed
    before and after some main targets. They are:
    -pre-init: called before initialization of project properties
    -post-init: called after initialization of project properties
    -pre-compile: called before javac compilation
    -post-compile: called after javac compilation
    -pre-compile-single: called before javac compilation of single file
    -post-compile-single: called after javac compilation of single file
    -pre-compile-test: called before javac compilation of JUnit tests
    -post-compile-test: called after javac compilation of JUnit tests
    -pre-compile-test-single: called before javac compilation of single JUnit test
    -post-compile-test-single: called after javac compilation of single JUunit test
    -pre-jar: called before JAR building
    -post-jar: called after JAR building
    -post-clean: called after cleaning build products
    (Targets beginning with '-' are not intended to be called on their own.)
    Example of inserting an obfuscator after compilation could look like this:
    <target name="-post-compile">
    <obfuscate>
    <fileset dir="${build.classes.dir}"/>
    </obfuscate>
    </target>
    For list of available properties check the imported
    nbproject/build-impl.xml file.
    Another way to customize the build is by overriding existing main targets.
    The targets of interest are:
    -init-macrodef-javac: defines macro for javac compilation
    -init-macrodef-junit: defines macro for junit execution
    -init-macrodef-debug: defines macro for class debugging
    -init-macrodef-java: defines macro for class execution
    -do-jar-with-manifest: JAR building (if you are using a manifest)
    -do-jar-without-manifest: JAR building (if you are not using a manifest)
    run: execution of project
    -javadoc-build: Javadoc generation
    test-report: JUnit report generation
    An example of overriding the target for project execution could look like this:
    <target name="run" depends="BetaCourseworkJava3d_TestsBACKUPSUNDAY05April-impl.jar">
    <exec dir="bin" executable="launcher.exe">
    <arg file="${dist.jar}"/>
    </exec>
    </target>
    Notice that the overridden target depends on the jar target and not only on
    the compile target as the regular run target does. Again, for a list of available
    properties which you can use, check the target you are overriding in the
    nbproject/build-impl.xml file.
    -->
    </project>
    {code}
    my Manifest:
    {code}Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.0
    Created-By: 10.0-b19 (Sun Microsystems Inc.)
    X-COMMENT: Main-Class will be added automatically by build
    {code}
    And my whole code (although I have like 4 .JAVA files in my project):
    {code}
    package courseworkjava3d;
    import java.awt.*;
    import java.awt.event.*;
    import com.sun.j3d.utils.geometry.*;
    import com.sun.j3d.utils.universe.*;
    import javax.swing.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import javax.media.j3d.PositionPathInterpolator;
    import javax.media.j3d.Alpha;
    import javax.media.j3d.BoundingSphere;
    import com.sun.j3d.utils.applet.MainFrame;
    import java.applet.Applet;
    import java.awt.event.WindowAdapter;
    import javax.swing.Timer;
    import com.sun.j3d.utils.image.*;
    public class Simple3D extends JFrame implements ActionListener, KeyListener
    private TransformGroup objTransxx;
    private Button go = new Button("Press to start the Bouncing Ball. Press A and S to move the ball Left and Right once it started!");
    private Transform3D transxx = new Transform3D();
    private float height=0.0f;
    private float sign = 1.0f; // aller vers le haut ou vers le bas
    private Timer timer;
    private float xloc=-2.25f;
    public Simple3D()
    setSize(800, 800);
    GraphicsConfiguration graphicsConfig = SimpleUniverse.getPreferredConfiguration();
    Canvas3D canvas = new Canvas3D(graphicsConfig);
    getContentPane().add("Center", canvas);
    BasicUniverse universe = new BasicUniverse(canvas, 8.0f);
    // Rotate the view platform by PI/4 radians about X in the BasicUniverse
    TransformGroup viewTransform = universe.getViewPlatformTransform();
    Transform3D transform = new Transform3D();
    transform.rotX(-Math.PI / 4.0);
    Transform3D currentTransform = new Transform3D();
    viewTransform.getTransform(currentTransform);
    transform.mul(currentTransform);
    viewTransform.setTransform(transform);
    // Add something to display
    BranchGroup scene = createCubeGraph();
    universe.addBranchGraph(scene);
    /* //ultra important! comment theses lines otherwise it bugs!
    //Merde
    setLayout(new BorderLayout());
    GraphicsConfiguration config =
    SimpleUniverse.getPreferredConfiguration();
    Canvas3D c = new Canvas3D(config); */
    add("Center", canvas);
    //i messed up te code, i replaced canvas c by "canvas" as i already had one!
    canvas.addKeyListener(this);
    timer = new Timer(75,this);
    //timer.start();
    Panel p =new Panel();
    p.add(go);
    add("North",p);
    go.addActionListener(this);
    go.addKeyListener(this);
    // Cr�er une sc�ne simple et l�ajouetr � l�univers
    //BranchGroup scene2 = createCubeGraph();
    //SimpleUniverse u = new SimpleUniverse(c);
    //u.getViewingPlatform().setNominalViewingTransform();
    //u.addBranchGraph(scene2);
    //End Merde
    public BranchGroup createCubeGraph() {
    BranchGroup Humanoid = new BranchGroup();
    //Debut Ball REBOUND
    // Create the root of the branch graph
    //BranchGroup objRoot = new BranchGroup();
    objTransxx = new TransformGroup();
    objTransxx.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    Humanoid.addChild(objTransxx);
    // Cr�er une forme simple et l�ajouter au graph de sc�ne
    Sphere spherex = new Sphere(0.85f);
    objTransxx = new TransformGroup();
    objTransxx.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    Transform3D pos1 = new Transform3D();
    pos1.setTranslation(new Vector3f(-2.0f,0.0f,-2.0f));
    objTransxx.setTransform(pos1);
    objTransxx.addChild(spherex);
    Humanoid.addChild(objTransxx);
    BoundingSphere boundsx =
    new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
    // I messed up the colors: I have applied 2 times some colorslights to the same BranchGroup
    Color3f light1Colorx = new Color3f(1.0f, 1.0f, 1.0f);
    Vector3f light1Directionx = new Vector3f(4.0f, -7.0f, -12.0f);
    DirectionalLight light1x
    = new DirectionalLight(light1Colorx, light1Directionx);
    light1x.setInfluencingBounds(boundsx);
    Humanoid.addChild(light1x);
    // R�gler la lumi�re ambiante
    Color3f ambientColorx = new Color3f(1.0f, 1.0f, 1.0f);
    AmbientLight ambientLightNodex = new AmbientLight(ambientColorx);
    ambientLightNodex.setInfluencingBounds(boundsx);
    Humanoid.addChild(ambientLightNodex);
    // END BallRebound
    // Apparence BODY
    // Configurer les couleurs
    Color3f blackbody = new Color3f(0.0f, 0.0f, 0.0f);
    Color3f whitebody = new Color3f(1.0f, 1.0f, 1.0f);
    Color3f redbody = new Color3f(0.8f, .85f, .85f);
    // Configurer la texture
    //if I want it in Black and white i need to replace RGB by LUMINANCE
    TextureLoader loaderbody = new TextureLoader("C:\\java3d\\body.jpg", "RGB", new Container());
    Texture texturebody = loaderbody.getTexture();
    texturebody.setBoundaryModeS(Texture.WRAP);
    texturebody.setBoundaryModeT(Texture.WRAP);
    texturebody.setBoundaryColor( new Color4f( 1.0f, 1.0f, 0.0f, 0.0f ) );
    // Configurer les attributs de la texture
    // Param�tres possibles : REPLACE, BLEND ou DECAL (ici, MODULATE)
    TextureAttributes texAttrbody = new TextureAttributes();
    texAttrbody.setTextureMode(TextureAttributes.MODULATE);
    Appearance apbody = new Appearance();
    apbody.setTexture(texturebody);
    apbody.setTextureAttributes(texAttrbody);
    //Configurer le mat�riau
    apbody.setMaterial(new Material(redbody, blackbody, redbody, blackbody, 1.0f));
    // Cr�er une sph�re pour y appliquer les textures
    int primflagsbody = Primitive.GENERATE_NORMALS + Primitive.GENERATE_TEXTURE_COORDS;
    // End Apparence BODY
    // Apparence BODYHEAD
    // Configurer les couleurs
    Color3f blackbodyH = new Color3f(0.0f, 0.0f, 0.0f);
    Color3f whitebodyH = new Color3f(1.0f, 1.0f, 1.0f);
    Color3f redbodyH = new Color3f(0.8f, .85f, .85f);
    // Configurer la texture
    //if I want it in Black and white i need to replace RGB by LUMINANCE
    TextureLoader loaderbodyH = new TextureLoader("C:\\java3d\\head.jpg", "RGB", new Container());
    Texture texturebodyH = loaderbodyH.getTexture();
    texturebodyH.setBoundaryModeS(Texture.WRAP);
    texturebodyH.setBoundaryModeT(Texture.WRAP);
    texturebodyH.setBoundaryColor( new Color4f( 1.0f, 1.0f, 0.0f, 0.0f ) );
    // Configurer les attributs de la texture
    // Param�tres possibles : REPLACE, BLEND ou DECAL (ici, MODULATE)
    TextureAttributes texAttrbodyH = new TextureAttributes();
    texAttrbodyH.setTextureMode(TextureAttributes.MODULATE);
    Appearance apbodyH = new Appearance();
    apbodyH.setTexture(texturebodyH);
    apbodyH.setTextureAttributes(texAttrbodyH);
    //Configurer le mat�riau
    apbodyH.setMaterial(new Material(redbodyH, blackbodyH, redbodyH, blackbodyH, 1.0f));
    // Cr�er une sph�re pour y appliquer les textures
    int primflagsbodyH = Primitive.GENERATE_NORMALS + Primitive.GENERATE_TEXTURE_COORDS;
    // End Apparence BODY HEAD
    //for the trunk c le corps
    TransformGroup fortheTrunk = new TransformGroup();
    //will allow to modify object wgile executing
    fortheTrunk.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    //alpha rotation time related
    Alpha rotationAlpha2=new Alpha(-1,9000);
    //behviour for our rotation
    RotationInterpolator rotator2= new RotationInterpolator(rotationAlpha2,fortheTrunk);
    // area where rotation will be
    BoundingSphere bounds2=new BoundingSphere();
    rotator2.setSchedulingBounds(bounds2);
    fortheTrunk.addChild(rotator2);
    //end of rtotation
    Alpha transAlphahuman=new Alpha(-1,600);
    //transform 3d trans for the interpolatipon HUMANOID
    Transform3D transhumanoid=new Transform3D();
    //matrix for 2positions
    Point3f[] cheminhuman=new Point3f[3];
    cheminhuman[0]=new Point3f(0.8f,0.0f,0.0f);
    cheminhuman[1]=new Point3f(-0.8f,0.0f,0.0f);
    cheminhuman[2]=new Point3f(0.8f,0.0f,0.0f);
    //matrix of floats to make the dots match with timeline
    float[] timePositionhuman={0.0f,0.50f,1.0f};
    PositionPathInterpolator interpolhuman=new PositionPathInterpolator(transAlphahuman,fortheTrunk,transhumanoid,timePositionhuman,cheminhuman);
    BoundingSphere bounds4=new BoundingSphere();
    interpolhuman.setSchedulingBounds(bounds4);
    fortheTrunk.addChild(interpolhuman);
    //add the trunk to the branchgroup
    Humanoid.addChild(fortheTrunk);
    TransformGroup zeTrunk = new TransformGroup();
    zeTrunk.addChild(new com.sun.j3d.utils.geometry.Box(.55f,.80f,.50f,
    primflagsbody,apbody));
    //t3D for the head= bouge up
    Transform3D T3DHead = new Transform3D();
    T3DHead.set(new Vector3f(0f,1.1f,0f));
    //create a tranform group for this t3Dhead
    TransformGroup fortheHead = new TransformGroup();
    fortheHead.setTransform(T3DHead);
    //add the box head
    //fortheHead.addChild(new com.sun.j3d.utils.geometry.Box(.20f,.20f,.10f, primflagsbody,apbody));
    fortheHead.addChild(new com.sun.j3d.utils.geometry.Sphere(0.35f,primflagsbodyH,apbodyH));
    /* I dont need that anymore it was for putting a flat texture on a face. I chose a sphere instead!
    //transform 3D for the face
    Transform3D T3DFace = new Transform3D();
    T3DFace.set(new Vector3f(0f,0f,.14f));
    //create a TransformGroup for this Face
    TransformGroup Face = new TransformGroup();
    Face.setTransform(T3DFace);
    //add the child box to the face;
    Face.addChild(new com.sun.j3d.utils.geometry.Box(.20f,.20f,.2f,
    primflagsbodyH,apbodyH));
    //add this face to the head as a child
    fortheHead.addChild(Face);
    //tranform3d left arm
    Transform3D T3DArmL = new Transform3D();
    T3DArmL.set(new Vector3f(-0.79f,0.73f,0f));
    //create Tranform Group for the leftarm
    TransformGroup fortheArmL = new TransformGroup();
    fortheArmL.setTransform(T3DArmL);
    //add the group for upperarm
    TransformGroup ArmL = new TransformGroup();
    ArmL.addChild(new com.sun.j3d.utils.geometry.Box(.25f,.14f,.10f,
    primflagsbody,apbody));
    fortheArmL.addChild(ArmL);
    //create a transform3D for the forearmleft
    Transform3D T3DForearmL = new Transform3D();
    T3DForearmL.set(new Vector3f(-.51f,0f,0f));
    //create the tranformgroup for the forearmleft
    TransformGroup ForearmL = new TransformGroup();
    ForearmL.setTransform(T3DForearmL);
    //add the child box to forearm
    ForearmL.addChild(new com.sun.j3d.utils.geometry.Box(.20f,.14f,.10f,
    primflagsbody,apbody));
    ArmL.addChild(ForearmL);
    //create transform 3d for the lefthand
    Transform3D T3DHandL = new Transform3D();
    T3DHandL.set(new Vector3f(-.42f,0f,0f));
    //create the child tranform group for the box of the hand
    TransformGroup HandL= new TransformGroup();
    HandL.setTransform(T3DHandL);
    //add the child hand to the forearm
    ForearmL.addChild(HandL);
    //create the box for the handLeft
    HandL.addChild(new com.sun.j3d.utils.geometry.Box(.10f,.140f,.10f,
    primflagsbody,apbody));
    //Right Arm
    //tranform3d right arm
    Transform3D T3DArmR = new Transform3D();
    T3DArmR.set(new Vector3f(0.79f,0.73f,0f));
    //create Tranform Group for the right arm
    TransformGroup fortheArmR = new TransformGroup();
    fortheArmR.setTransform(T3DArmR);
    //add the group for upperarm right
    TransformGroup ArmR = new TransformGroup();
    ArmR.addChild(new com.sun.j3d.utils.geometry.Box(.25f,.14f,.10f, primflagsbody,apbody));
    //com.sun.j3d.utils.geometry.Box.GENERATE_NORMALS,new Appearance()));
    fortheArmR.addChild(ArmR);
    //create a transform3D for the forearmright
    Transform3D T3DForearmR = new Transform3D();
    T3DForearmR.set(new Vector3f(.51f,0f,0f));
    //create the tranformgroup for the forearmright
    TransformGroup ForearmR = new TransformGroup();
    ForearmR.setTransform(T3DForearmR);
    //add the child box to forearmright
    ForearmR.addChild(new com.sun.j3d.utils.geometry.Box(.20f,.14f,.10f, primflagsbody,apbody));
    ArmR.addChild(ForearmR);
    //create transform 3d for the righthand
    Transform3D T3DHandR = new Transform3D();
    T3DHandR.set(new Vector3f(.42f,0f,0f));
    //create the child tranform group for the box of the hand
    TransformGroup HandR= new TransformGroup();
    HandR.setTransform(T3DHandR);
    //add the child hand to the forearmright
    ForearmR.addChild(HandR);
    //create the box for the handright
    HandR.addChild(new com.sun.j3d.utils.geometry.Box(.10f,.14f,.10f, primflagsbody,apbody));
    //Left Leg
    //tranform3d left leg
    Transform3D T3DLegL = new Transform3D();
    T3DLegL.set(new Vector3f(0.43f,-1.23f,0f));
    //create Tranform Group for the leftleg
    TransformGroup fortheLegL = new TransformGroup();
    fortheLegL.setTransform(T3DLegL);
    //add the group for uppeleg
    TransformGroup LegL = new TransformGroup();
    LegL.addChild(new com.sun.j3d.utils.geometry.Box(.16f,.35f,.10f, primflagsbody,apbody));
    fortheLegL.addChild(LegL);
    //create a transform3D for the downlegleft
    Transform3D T3DDownLegL = new Transform3D();
    T3DDownLegL.set(new Vector3f(0f,-.70f,0f));
    //create the tranformgroup for the downegleft
    TransformGroup DownLegL = new TransformGroup();
    DownLegL.setTransform(T3DDownLegL);
    //add the child box to downlegm
    DownLegL.addChild(new com.sun.j3d.utils.geometry.Box(.16f,.25f,.10f, primflagsbody,apbody));
    LegL.addChild(DownLegL);
    //create transform 3d for the leftfeet
    Transform3D T3DFeetL = new Transform3D();
    T3DFeetL.set(new Vector3f(.0f,-.45f,0f));
    //create the child tranform group for the box of thefeet
    TransformGroup FeetL= new TransformGroup();
    FeetL.setTransform(T3DFeetL);
    //add the child hand to the downleg
    DownLegL.addChild(FeetL);
    //create the box for the feetLeft
    FeetL.addChild(new com.sun.j3d.utils.geometry.Box(.16f,.10f,.15f, primflagsbody,apbody));
    //Right Leg
    //tranform3dright leg
    Transform3D T3DLegR = new Transform3D();
    T3DLegR.set(new Vector3f(-0.43f,-1.23f,0f));
    //create Tranform Group for the righttleg
    TransformGroup fortheLegR = new TransformGroup();
    fortheLegR.setTransform(T3DLegR);
    //add the group for uppelegR
    TransformGroup LegR = new TransformGroup();
    LegR.addChild(new com.sun.j3d.utils.geometry.Box(.16f,.35f,.10f, primflagsbody,apbody));
    fortheLegR.addChild(LegR);
    //create a transform3D for the downlegright
    Transform3D T3DDownLegR = new Transform3D();
    T3DDownLegR.set(new Vector3f(0f,-.70f,0f));
    //create the tranformgroup for the downegright
    TransformGroup DownLegR = new TransformGroup();
    DownLegR.setTransform(T3DDownLegR);
    //add the child box to downlegRight
    DownLegR.addChild(new com.sun.j3d.utils.geometry.Box(.16f,.25f,.10f, primflagsbody,apbody));
    LegR.addChild(DownLegR);
    //create transform 3d for the rightfeet
    Transform3D T3DFeetR = new Transform3D();
    T3DFeetR.set(new Vector3f(.0f,-.45f,0f));
    //create the child tranform group for the box of thefeetright
    TransformGroup FeetR= new TransformGroup();
    FeetR.setTransform(T3DFeetR);
    //add the child feet right to the downleg
    DownLegR.addChild(FeetR);
    //create the box for the feetright
    FeetR.addChild(new com.sun.j3d.utils.geometry.Box(.16f,.10f,.15f, primflagsbody,apbody));
    //rajoute la box zetrunk et des fils
    fortheTrunk.addChild(zeTrunk);
    fortheTrunk.addChild(fortheHead);
    fortheTrunk.addChild(fortheArmL);
    fortheTrunk.addChild(fortheArmR);
    fortheTrunk.addChild(fortheLegL);
    fortheTrunk.addChild(fortheLegR);
    //DEBUT CUBE
    //beginning of rotation
    TransformGroup objSpin=new TransformGroup();
    //create transform 3d for box which spin
    Transform3D T3DobjSpin = new Transform3D();
    T3DobjSpin.set(new Vector3f(-2.50f,.45f,0f));
    //create the child tranform group for the box which spin
    objSpin.setTransform(T3DobjSpin);
    //will allow to modify object while executing
    objSpin.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    //alpha rotation time related
    Alpha rotationAlpha=new Alpha(-1,900);
    Alpha transAlpha=new Alpha(-1,900);
    //transform 3d trans for the interpolatipon
    Transform3D trans=new Transform3D();
    //matrix for 2positions
    Point3f[] chemin=new Point3f[3];
    chemin[0]=new Point3f(-2.8f,0.40f,1.0f);
    chemin[1]=new Point3f(-0.8f,0.40f,1.0f);
    chemin[2]=new Point3f(-2.8f,0.40f,1.0f);
    //matrix of floats to make the dots match with timeline
    float[] timePosition={0.0f,0.50f,1.0f};
    PositionPathInterpolator interpol=new PositionPathInterpolator(transAlpha,objSpin,trans,timePosition,chemin);
    BoundingSphere bounds3=new BoundingSphere();
    interpol.setSchedulingBounds(bounds3);
    objSpin.addChild(interpol);
    //behviour for our rotation
    RotationInterpolator rotator= new RotationInterpolator(rotationAlpha,objSpin);
    // area where rotation will be
    BoundingSphere bounds=new BoundingSphere();
    rotator.setSchedulingBounds(bounds);
    objSpin.addChild(rotator);
    //end of rtotation
    //add transform group objspin to branchgroup humanoid
    Humanoid.addChild(objSpin);
    //test a cube which heritate of this rotation?
    objSpin.addChild(new ColorCube(0.25));
    //test
    //module cube + transparency
    // create an ALPHA transparency apparence (invisible)
    Appearance app0x=new Appearance();
    app0x.setColoringAttributes(new ColoringAttributes(new Color3f(0.3f,0.2f,1.0f),ColoringAttributes.SHADE_GOURAUD));
    app0x.setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.NICEST,0.5f));//0.5f represente 50% de transparence
    // create the blue sphere which rotate
    Transform3D transsphere=new Transform3D();
    transsphere.set(new Vector3f(0.0f, -0.1f, 0.3f));
    TransformGroup TGsphere=new TransformGroup(transsphere);
    TGsphere.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    objSpin.addChild(TGsphere);
    //objRotatecube.addChild(TGsphere);
    TGsphere.addChild( new Sphere(0.3f,app0x) );
    //End Module Cube + Transparency
    //END CUBE
    //DEBUT WHOLE BIRD
    //beginning of Rotation for Bird
    TransformGroup Bird=new TransformGroup();
    //will allow to modify object while executing
    Bird.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    //alpha rotation time related
    Alpha rotationAlphaBird=new Alpha(-1,400);
    Alpha transAlphaBird=new Alpha(-1,5990);
    //transform 3d trans for the interpolatipon
    Transform3D transBird=new Transform3D();
    //create transform 3d for the Bird
    transBird.set(new Vector3f(1.90f,-.45f,0.9f));
    //create the child tranform group for the Bird Box
    Bird.setTransform(transBird);
    //matrix for 2positions
    Point3f[] cheminBird=new Point3f[3];
    cheminBird[0]=new Point3f(1.95f,0.0f,-6.8f);
    cheminBird[1]=new Point3f(1.95f,0.90f,-0.8f);
    cheminBird[2]=new Point3f(1.95f,0.0f,5.8f);
    //matrix of floats to make the dots match with timeline
    float[] timePositionBird={0.00f,0.50f,1.0f};
    PositionPathInterpolator interpolBird=new PositionPathInterpolator(transAlphaBird,Bird,transBird,timePosition,cheminBird);
    BoundingSphere bounds3Bird=new BoundingSphere();
    //BoundingSphere bounds3Bird= new BoundingSphere(new Point3d(0.0, 0.0, -50.0), 0.5);
    interpolBird.setSchedulingBounds(bounds3Bird);
    Bird.addChild(interpolBird);
    //behviour for our rotation
    RotationInterpolator rotatorBird= new RotationInterpolator(rotationAlphaBird,Bird);
    // area where rotation will be
    BoundingSphere boundsBird=new BoundingSphere();
    rotatorBird.setSchedulingBounds(boundsBird);
    Bird.addChild(rotatorBird);
    //end of rotation For Bird
    //add transform group objspin to branchgroup humanoid
    Humanoid.addChild(Bird);
    //debut test APPARENCE Wing Left
    //test textures
    // Configurer les couleurs
    Color3f blackx = new Color3f(0.0f, 0.0f, 0.0f);
    Color3f whitex = new Color3f(1.0f, 1.0f, 1.0f);
    Color3f redx = new Color3f(0.7f, .75f, .75f);
    // Configurer la texture
    TextureLoader loaderx = new TextureLoader("C:\\java3d\\pois.jpg", "RGB", new Container());
    Texture texturex = loaderx.getTexture();
    texturex.setBoundaryModeS(Texture.WRAP);
    texturex.setBoundaryModeT(Texture.WRAP);
    texturex.setBoundaryColor( new Color4f( 0.0f, 1.0f, 0.0f, 0.0f ) );
    // Configurer les attributs de la texture
    // Param�tres possibles : REPLACE, BLEND ou DECAL (ici, MODULATE)
    TextureAttributes texAttrx = new TextureAttributes();
    texAttrx.setTextureMode(TextureAttributes.REPLACE);
    Appearance apx = new Appearance();
    apx.setTexture(texturex);
    apx.setTextureAttributes(texAttrx);
    //Configurer le mat�riau
    apx.setMaterial(new Material(redx, blackx, redx, blackx, 1.0f));
    int primflagsx = Primitive.GENERATE_NORMALS + Primitive.GENERATE_TEXTURE_COORDS;
    //End test APPARENCE Wing Left
    //test a cube which heritate of this rotation?
    // Bird.addChild(new ColorCube(0.8));
    //test bird body
    // Bird.addChild(new com.sun.j3d.utils.geometry.Box(.25f,.22f,.45f,
    // com.sun.j3d.utils.geometry.Box.GENERATE_NORMALS,new Appearance()));
    Bird.addChild(new com.sun.j3d.utils.geometry.Box(.25f,.22f,.45f, primflagsx,apx));
    //test WingRightBird
    //create a transform3D for the BirdWIngR
    Transform3D T3DBirdWingR = new Transform3D();
    T3DBirdWingR.set(new Vector3f(0.45f,.0f,-0.35f));
    //create the tranformgroup for the BirdWIngR
    TransformGroup BirdWingR = new TransformGroup();
    BirdWingR.setTransform(T3DBirdWingR);
    //add the child box to BirdWIngR
    // BirdWingR.addChild(new com.sun.j3d.utils.geometry.Box(.43f,.07f,.22f,
    // com.sun.j3d.utils.geometry.Box.GENERATE_NORMALS,new Appearance()));
    //End test WingRightBird
    ////////comments/////////
    //beginning of Rotating WINR
    //----------------------d�but de la cr�ation de la rotation--------------------------------
    TransformGroup WinRSpin=new TransformGroup();
    // permet de modifier l'objet pendant l'execution
    WinRSpin.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    // on cr�e un fonction de rotation au cours du temps
    Alpha rotationAlphaWinRSpin=new Alpha(-1,1000);
    Transform3D rot = new Transform3D();
    rot.rotX((float)Math.PI/- 2.0f);
    //rot.rotX(-45);
    //rot.rotX((-Math.PI / 4.0)+30);
    //rot.rotZ((-Math.PI / 4.0));
    //rot.rotX(-Math.PI / 4.0);
    //rot.rotY(-Math.PI / 4.0);
    // rot.rotZ(-Math.PI / 4.0);
    // rot.rotY(00);
    //rot.rotZ(45);
    // on cr�e un comportement qui va appliquer la rotation � l'objet voulu
    // on d�finit la zone sur laquelle va s'appliquer la rotation
    //RotationInterpolator rotatorWinRSpin=new RotationInterpolator(rotationAlphaWinRSpin,WinRSpin, rot, 0.50f,(float)(2.0*Math.PI));
    RotationInterpolator rotatorWinRSpin=new RotationInterpolator(rotationAlphaWinRSpin,WinRSpin, rot, 25,26);
    BoundingSphere boundsWinRSpin=new BoundingSphere(new Point3d((Math.PI / 4.0), 0.0, 0.0), 0.5);
    // boundsWinRSpin.setCenter(new Point3d((Math.PI / 4.0),0,0));
    boundsWinRSpin.setCenter(new Point3d(-10,0,0));
    //boundsWinRSpin.setCenter();
    //test put a t3d to a boundingsphere??
    //Transform3D T3Dbounding = new Transform3D();
    // T3Dbounding.set(new Vector3f(5.00f,0.0f,0.00f));
    //WinRSpin.setTransform(T3Dbounding);
    //end test put a t3d to a boundingsphere, not working
    rotatorWinRSpin.setSchedulingBounds(boundsWinRSpin);
    // test BoundingSphere of BODY BIRD rotatorWinRSpin.setSchedulingBounds(boundsBird);
    WinRSpin.addChild(rotatorWinRSpin);
    //----------------------End de la cr�ation de la rotation--------------------------------
    BirdWingR.addChild(WinRSpin);
    // on cree un cube qui h�rite de la rotation
    //WinRSpin.addChild(new ColorCube(0.5));// de rayon 50 cm
    WinRSpin.addChild(new com.sun.j3d.utils.geometry.Box(.43f,.07f,.22f, primflagsx,apx));
    //End of Rotating WINR
    //////// END comments/////////
    //I commented the following, that was the TEST sinusoidal, rotation which help me understood how to rotate wingR
    // -----------d�but de cr�ation de la rotation--------------------------------------------------
    TransformGroup objSpinxx=new TransformGroup();
    // permet de modifier l'objet pendant l'execution
    objSpinxx.setCapability(TransformGroup.ALL

    Thank you very much!
    I cant believe this little comment has been so helpful!
    But yes it is:
    I explain, despite my efforts to find, googled it, forums, faqs, etc...
    no where it mentionned the manifest.fm file is... INSIDE the .jar!
    Your comment "a zip" made me attempt to open it with winrar, and I found a manifest.fm file inside!
    So far I was editing the one at the "source" of my project and rebuilding it with netbeans.
    I am going to try that now.
    Actually.... :( no its mentionning my main class!
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.0
    Created-By: 10.0-b19 (Sun Microsystems Inc.)
    Main-class: courseworkjava3d.Simple3D
    Class-Path:
    X-COMMENT: Main-Class will be added automatically by buildWell I have no problems uploading you the .jar, it is for a coursework it is not a private project or whatever:
    http://www.uploading.com/files/CM2LKWYU/BetaCourseworkJava3d_Final.jar.html
    Oh and I felt on your comment "dont ask us" as if I was suppose to know... i'm a beginner, I did not know that! And I tried to give you so many infos so you dont lose your time if you want to help, especially as after my own research I found many, many results for this "main class" and I tried a few solutions!
    Edited by: CupofTea on Apr 13, 2008 3:28 AM

  • How can I assign image file name from Main() class

    I am trying to create library class which will be accessed and used by different applications (with different image files to be assigned). So, what image file to call should be determined by and in the Main class.
    Here is the Main class
    import org.me.lib.MyJNIWindowClass;
    public class Main {
    public Main() {
    public static void main(String[] args) {
    MyJNIWindowClass mw = new MyJNIWindowClass();
    mw.s = "clock.gif";
    And here is the library class
    package org.me.lib;
    public class MyJNIWindowClass {
    public String s;
    ImageIcon image = new ImageIcon("C:/Documents and Settings/Administrator/Desktop/" + s);
    public MyJNIWindowClass() {
    JLabel jl = new JLabel(image);
    JFrame jf = new JFrame();
    jf.add(jl);
    jf.setVisible(true);
    jf.pack();
    I do understand that when I am making reference from main() method to MyJNIWindowClass() s first initialized to null and that is why clock could not be seen but how can I assign image file name from Main() class for library class without creating reference to Main() from MyJNIWindowClass()? As I said, I want this library class being accessed from different applications (means different Main() classes).
    Thank you.

    Your problem is one of timing. Consider this simple example.
    public class Example {
        public String s;
        private String message = "Hello, " + s;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example();
            ex.s = "world";
            System.out.println(ex.toString());
    }When this code is executed, the following happens in order:
    1. new Example() is executed, causing an object to constructed. In particular:
    2. field s is given value null (since no value is explicitly assigned.
    3. field message is given value "Hello, null"
    4. Back in method main, field s is now given value "world", but that
    doesn't change message.
    5. Finally, "Hello, null" is output.
    The following fixes the above example:
    public class Example {
        private String message;
        public Example(String name) {
            message = "Hello, " + name;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example("world");
            System.out.println(ex.toString());
    }

  • How to run 1 or more main classes in a jar?

    Hi there,
    I have 2 or more main classes in a java project. How do I create more than one application entry point in my MANIFEST.INF? I create my jar file from my java project using Eclipse, and it asked me to "Select the class of the application entry point". I was only able to select one main class.
    I noticed the MANIFEST.INF file that eclipse generated looks like:
    Manifest-Version: 1.0
    Main-Class: Automobile
    When I tried to run my other classes not specify in the MANIFEST.INF it failed and only look for the Automobile class:
    java -jar /tmp/Auto.jar TestMe

    Your app. can have as many entry points as you like, as atmguy demonstrated. But you can only specify one in the manifest,which - if you think about it - makes perfect sense. How is the machine to determine - from you clicking on the jar - which entry point you meant to invoke?

  • Using main class's methods from a different class in the same file

    Hi guys. Migrating from C++, hit a few snags. Hope someone can furnish a quick word of advice here.
    1. The filename is test.java, so test is the main class. This code and the topic title speak for themselves:
    class SomeClass
         public void SomeMethod()
              System.out.println(test.SomeOperation());
    public class test
         public static void main(String args[])
              SomeClass someObject = new SomeClass();
              someObject.SomeMethod();
         public static String SomeOperation()
              return "SomeThing";
    }The code works fine. What I want to know is, is there some way to use test.SomeOperation() from SomeClass without the test.?
    2. No sense opening a second topic for this, so second question: Similarly, is there a good way to refer to System.out.println without the System.out.? Like the using keyword in C++.
    Thanks.

    pfiinit wrote:
    The code works fine. What I want to know is, is there some way to use test.SomeOperation() from SomeClass without the test.?Yes you can by using a static import, but I don't recommend it. SomeOperation is a static method of the test class, and it's best to call it that way so you know exactly what your code is doing here.
    2. No sense opening a second topic for this, so second question: Similarly, is there a good way to refer to System.out.println without the System.out.? Like the using keyword in C++.Again, you could use static imports, but again, I don't recommend it. Myself, I use Eclipse and set up its template so that when I type sop it automatically spits out System.out.println(). Most decent IDE's have this capability.
    Also, you may wish to look up Java naming conventions, since if you abide by them, it will make it easier for others to understand your code.
    Much luck and welcome to this forum!

Maybe you are looking for

  • How can I download 500MB to 50 devices in 5 minutes- WiFi

                       Hello, The off the shelf wifi routers are not able to solve my problem.  I need to download a 500 MB video file to 40-50 iPad2 within 5-10 minutes.  The network is not the issue, it is the WiFi router/APo I have setup a internal te

  • How to use sda6810 to receive data from a rs485 channel?

    I want to use sda6810 to anlyze data from a rs485 bus. So I use Labview to progame the sda6810 with the drivers.Firstly,I intilite the card,then I cofigued an channel to send data from a buffer,and configued another channel to receive data from the f

  • I bought GarageBand on my iPad and can't transfer it to my MacPro. Help?

    I purchased and downloaded GarageBand onto my iPad. On my macbook, in the app store, it says that garageband is installed but it is no where to b found. Are there 2 separate garagebands for your PC and ipad? If not how can I get the whole garageband

  • How to remotely control WebAS

    Hi, I'm using NetWeaver 2004S, NewYork 711 and NewYork 720, I want to find a solution to remotely control the server, such as remotely re-start WebAS or a specified service, (these WebAS cover windows, Linux, and unix platforms), it would be better i

  • Photoshop button as lightbox thumbnail?

    I made a photoshop button that I'd like to have trigger a movie in a lightbox, but it's not showing rollover state. Is this use for photoshop button possible?