Java 3D problem ...

I have a problem with java 3d, I would appreciate some help! I use JBuilder 2005.
I run Hello3d and it runs ok. its code follows:
package untitled1;
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2006</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.geometry.ColorCube;
import javax.media.j3d.BranchGroup;
//import java.awt.GraphicsConfiguration;
//import javax.media.j3d.Transform3D;
//import javax.media.j3d.TransformGroup;
public class Hello3d {
public Hello3d() {
// System.load("C:\\Program Files\\Java\\jre1.5.0_06\\bin\\J3D.dll");
// System.load("C:\\Program Files\\Java\\jre1.5.0_06\\bin\\j3daudio.dll");
// System.load("C:\\Program Files\\Java\\jre1.5.0_06\\bin\\J3DUtils.dll");
SimpleUniverse universe = new SimpleUniverse();
BranchGroup group = new BranchGroup();
group.addChild(new ColorCube(0.3));
universe.getViewingPlatform().setNominalViewingTransform();
universe.addBranchGraph(group);
public static void main(String[] args) {
new Hello3d();
} // end of class Hello3d
=============================================
Then, i try to run Ball() and I get the following message:
java.lang.UnsatisfiedLinkError: no J3D in java.library.path
     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1491)
     at java.lang.Runtime.loadLibrary0(Runtime.java:788)
     at java.lang.System.loadLibrary(System.java:834)
     at javax.media.j3d.MasterControl$22.run(MasterControl.java:889)
     at java.security.AccessController.doPrivileged(Native Method)
     at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:886)
     at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:229)
     at untitled2.Ball.<init>(Ball.java:38)
     at untitled2.Ball.main(Ball.java:80)
Exception in thread "main"
The Ball() code is:
package untitled2;
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2006</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.geometry.ColorCube;
import javax.media.j3d.BranchGroup;
import com.sun.j3d.utils.geometry.*;
import com.sun.j3d.utils.universe.*;
import javax.media.j3d.*;
import javax.vecmath.*;
public class Ball {
public Ball() {
System.load("C:\\Program Files\\Java\\jre1.5.0_06\\bin\\J3D.dll");
System.load("C:\\Program Files\\Java\\jre1.5.0_06\\bin\\j3daudio.dll");
System.load("C:\\Program Files\\Java\\jre1.5.0_06\\bin\\J3DUtils.dll");
// Create the universe
SimpleUniverse universe = new SimpleUniverse();
// Create a structure to contain objects
BranchGroup group = new BranchGroup();
// Create a ball and add it to the group of objects
Sphere sphere = new Sphere(0.5f);
group.addChild(sphere);
// Create a red light that shines for 100m from the origin
Color3f light1Color = new Color3f(1.8f, 0.1f, 0.1f);
BoundingSphere bounds =
new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
Vector3f light1Direction = new Vector3f(4.0f, -7.0f, -12.0f);
DirectionalLight light1
= new DirectionalLight(light1Color, light1Direction);
light1.setInfluencingBounds(bounds);
group.addChild(light1);
// look towards the ball
universe.getViewingPlatform().setNominalViewingTransform();
// add the group of objects to the Universe
universe.addBranchGraph(group);
public static void main(String[] args)
new Ball();
==============
could anyone please help me with this problem??
thanks

Note: This thread was originally posted in the [Java Programming|http://forums.sun.com/forum.jspa?forumID=31] forum, but moved to this forum for closer topic alignment.
edit
Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
Edited by: DarrylBurke

Similar Messages

  • Java Session problem while sending mail(using javamail) using Pl/SQL

    Hello ...
    i am using Java stored procedure to send mail. but i'm getting java session problem. means only once i can execute that procedure
    pls any help.

    props.put("smtp.gmail.com",host);I doubt javamail recognizes the 'smtp.gmail.com' property. I think it expects 'mail.host'. Of course since it cannot find a specified howt it assumes by default localhost
    Please format your code when you post the next time, there is a nice 'code' button above the post area.
    Mike

  • Java Programming Problem

    Hi all,
    I was looking for this java programming problem which had to do with a large building and there was some gallons of water involved in it too somehow and we had to figure out the height of the buiding using java. This problem is also in one of the java books and I really need to find out all details about this problem and the solution. NEED HELP!!
    Thanks
    mac

    Yes, it will. The water will drain from the bottom of
    the tank until the pressure from the water inside the
    tank equals the pressure from the pipe. In other
    words, without a pump, the water will drain out until
    there is the same amount of water in the tank as in
    the pipe The water pressure depends on the depth of the water, not the volume. So once the depth of the water inside the pipe reaches the same depth as the water inside the tank it will stop flowing. This will never be above the height of the tank.
    I found this applet which demonstrates our problem. If you run it you can drag the guy up to the top, when water in his hose reaches the level of the water in the tank it will stop flowing out.

  • Java Uninstall Problem

    Java Uninstall Problem
    This all came about because of a failed uninstall, using Your Uninstaller.
    The {Java runtime which is all I want) is not listed now & I tried all the other fix bad uninstall type features, all to no avail.} )
    When I DL & run the latest package (jxpiinstall-6u11-fcs-bin-b90-windows-i586-25_nov_2008.exe}
    & run it I get:
    1st message:
         "This software has already been installed on your computer.
         Would you like to install it?"
    If I say no, it exits.
    If I say yes, I get this second message:
         :This action is only valid for products that are currently installed."
    So Now I have no Java & have no idea what to do.
    Any help would be greatly appreciated.
    Thanks, Neuromancer23

    Sorry...after posting it i realized there was a more appropriate forum, of which it took quiet awhile to find.)
    Now that I know where to find the forum list I will never double-post again.
    I'll close the question if I can

  • Sun Java security problems

    Please any one tel me about Sun Java security problems
    with Desktop application

    Hi.
    If you're using SSGD 4.41, please download the Admin guide from here:
    http://docs.sun.com/app/docs/doc/820-4907
    There, at page #41 you'll find useful info concerning "Client Connections and Security Warnings".
    Hope this helps,
    Rob

  • OS X Lion - JAVA SCRIPT PROBLEM

    I recently updated from Snow Leopard to OS X Lion. Now I seem to have a JAVA Script problem. Where do I start fixing this issue. I have checked updates etc etc but it seems to be updated. However, when I login to my web site backend, I have a problem. Any advice please?

    Would you please write some more details? explain the problem and what web site backend you use. Thanks.

  • Adobe Dreamweaver CS5.5 - Windows 7 - Java Script Problem

    I am having trouble with Anchor.htm.
    When I try to insert an anchor in the text (Insert > Named Anchor> I get this error message:
    "While executing insertObject in Anchor.htm a Java Script error occurred."
    I recently downloaded both the 32- and 64-bit Java Script applications when I received a message that the existing version of Java Script was out-of-date. Anchor.htm worked before I installed the update.
    The files I downloaded and installed are:
    jre-7u9-windows-i586.exe
    jre-7u9-windows-x64.exe
    Please can anyone help me with this problem?

    From Dreamweaver FAQ
    http://forums.adobe.com/thread/429114
    "If Dreamweaver is acting erratically, or if you see a message saying "the following JavaScript error(s) occurred",  it's usually a sign of a corrupt cache file. The first thing to try should always be to delete the file cache. If that doesn't work, delete your personal Configuration folder. Full instructions are in Deleting a corrupted cache file.
    http://forums.adobe.com/thread/494811"
    Nancy O.

  • Java application problem

    I am using JDK1.4 and working on Windows Xp.
    I have written a code for application in java as follows:
    import javax.swing.*;
    public class sample
    JPanel panel;
    static JFrame frame;
    JButton but;
    public sample()
    frame=new JFrame("frame");
    panel=new JPanel();
    frame.getContentPane().add(panel);
    but=new JButton("click");
    panel.add(but);
    public static void main(String args[])
    sample s=new sample();
    frame.setSize(300,300);
    frame.setVisible(true);
    on executing program application window has appeared and it ran properly.
    Then I closed that application window.But after that in command prompt window curser was just blinking and it was not allow to enter also.
    I have tried pressing CTRL+C also.But situation in command prompt was same i.e curser in command prompt was just blinking.
    Then I closed cmd window ;but one error has occured saying that cmd window can not close .
    My friend has told me that she is also having windows xp and JDK1.4 ; ctrl+c is working properly in her command prompt.She has written the above same code in her computer and it executes properly.
    Even though she has not written following statement:
    "frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);"
    when she exits from application window ,her cmd window gave same problem of only blinking curser.But when she press CTRL+C ; her command prompt starts responding by giving root.But my command prompt is not giving
    positive responce to "ctrl+c" when I am exiting java application.
    Is it possible to solve this problem without giving statement
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ?
    Why my command prompt is not responding to CTRL+c?
    How can I tackle this problem ?
    Is there any other key which can be used in command prompt of Windows Xp?

    Is it possible to solve this problem without giving
    statement
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    ?this is because Swing have started some non-daemon helper threads for its internal purposes and the default close operation for frame is just HIDE_ON_CLOSE. So, the system will not exit because those non-daemon thread still not terminated.
    What is the problems setting the default close operation to JFrame.EXIT_ON_CLOSE ?

  • Java threading problem... threads only work on 1 processor

    I've got a iterative deepening problem that i have to parallelize. As far as i know i did everything correctly however everything seems to be running on 1 processor instead of 2 processors. As far as i know i am using threads (-Xprof either defines them as thread-1 thread-2 or pool1-thread1,depending on the method used for issueing)
    the worker thread is:
    public int solutionsT(Board board, int currentDepth) {
            int temp = 0;
            int result = 0;
            if (board.distance() == 0) {
               return 1;
            if (board.distance() > board.bound()) {
                return 0;
            Board[] children = board.makeMoves();
            result = 0;
            for (int i = 0; i < children.length; i++) {
                if (children[i] != null) {
                    temp = solutionsT(children, currentDepth + 1);
    if(temp != 0){
    result += temp;
    return result;
    public void run() {
    int temp =0;
    int i = 0;
    while(true){
    while(bag.size() !=0){
    bag.putSolution(solutionsT(bag.get(),1));
    try{   
    barrier.await();
    }catch(Exception e){}
    it get's it's input from a bag that is filled before the iteration begins. (once the bag is filled it trips a barrier) this worker thread is a implementation of Runnable
    This piece of code is used to make the thread object and to issue it
    public SolutionThread(int numberOfThreads) {
       thread = numberOfThreads;
       bag = new bagOfBoards();
       barrier = new CyclicBarrier(thread+1);
       if(thread > 1){
          ExecutorService threadExecutor = Executors.newFixedThreadPool( thread );
          solution = new ThreadTest[thread];
          bag = new bagOfBoards();
          for(int i = 0;i<thread;i++){
             solution[i] = new ThreadTest(bag, lock, barrier, i);
             threadExecutor.execute(solution);
    finally this is the code which is used to acces the bag and get a board.
    synchronized public Board get() {
                if (size > 0) {
                size--;
                Board result = bag[size];
                return result;
            } else {
             return null;
        }since this method is synchronized and it always returns something (either null or a board) and the worker tests for this. there is no race condition here.
    furter more. the main thread is a loop. It fills te bags with an intial state. then it trips the barrier and waits for the workers to do the work. the workers then process the bag until it hits zero and then trip the barrier so that the main thread can do the next iteration (and fill the bag)
    p.s. i know the code is a bit messy, but i want to get the threading to work. As of now i relaly don't understand why the threads are just running on 1 processor instead of 2 processors. not only that. the excecution time is nearly the same as that of a sequential equivalent.
    p.s.2 the code is parallisable. and it is run on a smp system.
    Message was edited by:
    jstrike

    i'm very sure that the jvm and os support smp. the
    problem really should be in the code.I don't see how this can be the case. There's nothing in the Java language that deals with how threads are assigned to processors (at least not as far as I know) so there isn't anything you can do in your code to affect that.
    Or did you meant that i have to tell the jvm in the class that
    there is support for multiple processorsThat would be the only possibility. I have no idea whether it can be done or not, though.

  • Java Threads Problem

    Hi, I am trying to write a simple java threads program where in one thread reads a file and another thread writes the data into a second file....
    Here is my code, although i think i am correct, my program still runs in a sequential fashion help help help!!!
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    class MyThread extends Thread{
    private int a;
    private int c;
    FileInputStream in;
    FileOutputStream out;
    public MyThread(int a){
    this.a = a;
    public void run(){
    if(this.a==5)
         try {
         in = new FileInputStream("Britney.txt");
    } catch (FileNotFoundException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
    try {
         while((c=in.read())!=-1)
              a = (char) c;
              System.out.println(a);
    catch (IOException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
    if(this.a==10)
         try {
              out = new FileOutputStream("romi.txt");
         } catch (FileNotFoundException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
         for(int i = 0;i<50;i++)
              try {
                   System.out.println(c);
                   out.write(c);
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    class MainMyThread{
    public static void main(String args[]){
    MyThread thr1, thr2;
    thr1 = new MyThread(5);
    thr2 = new MyThread(10);
    thr1.start();
    thr2.start();
    }

    Encephalopathic wrote:
    malcolmmc wrote:
    ... Chances of getting any kind of reply except "me too" can be pretty remote. ....there's actually a better chance of getting a reply on a general forum like this one, ....Can't you just post in both the narrow and the general forum, but include links one to the other in each thread? Or is that against the forum rules/etiquette? Most people here are ok with a crosspost IF those links are included.
    I would also ask that the OP designate one of those threads as the real discussion thread and just direct folks there from the other threads, so that we have one coherent discussion. If he does that, there's no problem with trying to reach out to as broad an audience as possible.
    I would figure that if the poster were upfront about what they are doing, folks wouldn't mind, but I could be wrong.I think that's generally the case. As long as the discussion is confined to one thread (and pointed there from the crossposts) or at the very least all the participants can see all the discussions, I think most people don't have a problem with it. It's when we waste our time answering when he's already got the answer elsewhere that's annoying.

  • SAP NetWeaver 04s SP9 for JAVA Installation problem on Windows Vista

    Hi Guys,
    Firstly, anyone installed WAS on Windows Vista home version?
      I have gone thru couple of postings in the SDN and disabled firewall but no use.
    here is link :   Port 21212 error : Couldn't install 2004s
      When I am trying to install, getting below problem.
    Error log
    <b>SAPinst is not available on localhost:21200
    Connection to SAPinstAdapter could not be established, see following messages.
    Could not connect to host localhost on port 21200
    Java.net.ConnectionException : Connection refused: connect</b>
    Thanks in advance for your quick reply....
    Prs.

    Hi Anand & Mahesh,
      Thanks for the quick reply.
    Any one of you got a chance to install NW04S 2007 or New York on Windows Vista?
    I think suggested one not available in SDN I guess.
      If I am not wrong, I can get it from Service.sap.com....
    Can you give me the complete path in the service.sap.com if you know....
    If this would not click, alternatively I am planning to change my operating system to Windows XP, this is not a good idea but I dont have option.
    Thanks in advance for quick reply.
    Regards
    Prs

  • Java installation problem on solaris

    Hi
    IAm a new born baby to solaris .I have installed
    java on solaris sparc machine 2.7 by using Solaris_JDK_1.2.2_sparc.bin.
    If i have done anything wrong ,Please correct me .My problem is :
    i have to include the rt.jar file in the classpath bcoz it contains all
    the class files .Then iam running command javac Test.java .Then i got error
    message as segmentation violation error and abort core dumped .I dont why i got this error .Please help me as soon possible .My email id is
    [email protected] .
    Thanks in advance
    bala

    The Solaris*.bin file should have unpacked everything and installed all the JDK in a directory off of the directory where you ran the .bin file. Inside this subdirectory will be a bin subdirectory where the java executables, etc are installed.

  • Sreaming at the top of my lungs for HELP with Java Script problem!

    Hello,
    I have this strange problem that no one seems to know why or how to fix it.Whenever I encounter a web site that has java scripting for anything pop ups or redirects to url's anything that says java script when I mouse over the link my browsers do nothing.That is for explorer 6.0 beta netscape 4.7 and netscape version 6.I have tried in another forum some suggestions but nothing changed even though I am told nothing is wrong with the java scripting.I used to be able to click java script's with all of these browsers but no longer.That was a few months ago.Now to try something new I tried to see if a new browser would work.I now have the latest version of Opera.It did work but using Opera on some sites limits what I can do so it doesn't solve my problem.Then I tried the Sun JavaHot browser it also worked but limits what I can do on some site's.I have Windows 98 & updated most of my dll's etc & my java is version 2 1.3.1.My java script is enabled in Explorer & netscape's & the security is at a minimum level.Please help me figure out why these other browsers work but the other's do not.I want to edit a web site of mine but I can't because of this problem.I am very frustrated by this and need as detailed help as I can get.Anything of a suggestion would be very much appreciated.But I am also not an expert on the working's of a computer so bear with me.
    Brian

    Hi,
    Well I am thinking that if anyone could know something about Java script it would be java developers.But anyways I had the previous version of explorer 5.0 & the java didn't work in it either.Now how weird is this,I opened netscape 4.7 today & the java scripts are suddenly working.This has me scratching my head wondering if my computer is possesed by some force beyond my capability to know...????Weird as it seems though the explorer still will not respond to a java script.
    Brian

  • Issue with launching Java Program - Java Library Problem?

    I hope this is the right forum, I apologize if it isn't. I am having issues launching a program for a video game that uses java. One of the devs told me to post my issue here, as he doesn't know how much more help he can give with this issue. Using the java -jar command, this is the printout I get:
    Microsoft Windows [Version 6.0.6002]
    Copyright (c) 2006 Microsoft Corporation.  All rights reserved.
    C:\Users\vecdran>java -version
    java version "1.6.0_20"
    Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
    Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
    C:\Users\vecdran>chdir C:\Games\Steam\Steamapps\common\Crysis\mods\mwll\actionma
    pper\dist
    C:\Games\Steam\steamapps\common\crysis\Mods\mwll\Actionmapper\dist>java -jar Act
    ionmapper.jar
    Jun 18, 2010 2:25:19 PM org.jdesktop.application.Application$1 run
    *SEVERE: Application class mwllactionmapper.MWLLActionmapperApp failed to launch*
    *java.lang.NullPointerException*
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at sun.swing.WindowsPlacesBar.<init>(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.updateUseShellFo
    lder(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponent
    s(Unknown Source)
    at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(Unknow
    n Source)
    at javax.swing.JComponent.setUI(Unknown Source)
    at javax.swing.JFileChooser.updateUI(Unknown Source)
    at javax.swing.JFileChooser.setup(Unknown Source)
    at javax.swing.JFileChooser.<init>(Unknown Source)
    at javax.swing.JFileChooser.<init>(Unknown Source)
    at mwllactionmapper.model.ActionmapsFileModel.getMWLLDocumentsFolder(Act
    ionmapsFileModel.java:141)
    at mwllactionmapper.model.ActionmapsFileModel.getMWLLProfiles(Actionmaps
    FileModel.java:160)
    at mwllactionmapper.MWLLActionmapperView.doSelectProfile(MWLLActionmappe
    rView.java:603)
    at mwllactionmapper.MWLLActionmapperView.<init>(MWLLActionmapperView.jav
    a:75)
    at mwllactionmapper.MWLLActionmapperApp.startup(MWLLActionmapperApp.java
    :21)
    at org.jdesktop.application.Application$1.run(Application.java:171)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class mwllac
    tionmapper.MWLLActionmapperApp failed to launch
    at org.jdesktop.application.Application$1.run(Application.java:177)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at sun.swing.WindowsPlacesBar.<init>(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.updateUseShellFo
    lder(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponent
    s(Unknown Source)
    at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(Unknow
    n Source)
    at javax.swing.JComponent.setUI(Unknown Source)
    at javax.swing.JFileChooser.updateUI(Unknown Source)
    at javax.swing.JFileChooser.setup(Unknown Source)
    at javax.swing.JFileChooser.<init>(Unknown Source)
    at javax.swing.JFileChooser.<init>(Unknown Source)
    at mwllactionmapper.model.ActionmapsFileModel.getMWLLDocumentsFolder(Act
    ionmapsFileModel.java:141)
    at mwllactionmapper.model.ActionmapsFileModel.getMWLLProfiles(Actionmaps
    FileModel.java:160)
    at mwllactionmapper.MWLLActionmapperView.doSelectProfile(MWLLActionmappe
    rView.java:603)
    at mwllactionmapper.MWLLActionmapperView.<init>(MWLLActionmapperView.jav
    a:75)
    at mwllactionmapper.MWLLActionmapperApp.startup(MWLLActionmapperApp.java
    :21)
    at org.jdesktop.application.Application$1.run(Application.java:171)
    ... 8 more
    C:\Games\Steam\steamapps\common\crysis\Mods\mwll\Actionmapper\dist>As you can see, my Java is completely up to date, and this is the only program I appear to have problems launching. I have no idea what to do from here. :(
    PS.
    I had to add the Java path to my System -> Environmental Variables -> Path variable, as it was not there from the start, and before adding it command prompt wouldn't recognize java commands. Don't know whether this indicates anything.
    Edited by: vecdran on Jun 20, 2010 11:23 AM

    [Bug ID 4711700|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4711700] is eerily similar to what you're experiencing. Although the bug was reported against an older version of the JDK the last comment provides a workaround to the problem that may be helpful. Good luck.

  • 1.4.2 Java Swing problems

    I have a swing application with 2 JComboBox 's, 1 JPanel (for pictures), 1 JButton and a scroll pane. Basicall the JComboBoxes have an action listener that changes the pictures when I cahnge the names. However, I would like the Jbutton when pressed to display the name chosen (from the JComboBox) and display it in the textArea. See code below.
    import javax.swing.*;
    import javax.swing.Action;
    import java.awt.event.ActionEvent;
    import  java.awt.event.ItemListener;
    import java.awt.*;
    import java.awt.event.*;
    * @author Administrator
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class choice_in2 extends JPanel implements ActionListener{
         private JLabel contender1FieldLabel;
         private JLabel contender2FieldLabel;
         private JButton runButton;
         JLabel picture1;
         JLabel picture2;
         //Text area which shows the result
         private JTextArea textArea;
         private JLabel textAreaLabel;
         public choice_in2(){
              //          Create a ChoiceField for the input of first contender
              contender1FieldLabel = new JLabel("Contender1 ",4);
              String[] contender1Strings = { "Bill", "Bob", "Don", "Michael", "John" };
              JComboBox contender1List = new JComboBox(contender1Strings);
              contender1List.setSelectedIndex(1);
              contender1List.addActionListener(new Eavesdropper1(picture1));
              //          Create a ChoiceField for the input of second contender
              contender2FieldLabel = new JLabel("Contender2 ",4);
              String[] contender2Strings = { "Philip", "Timothy", "Tom", "Kenneth", "Stone" };
              JComboBox contender2List = new JComboBox(contender2Strings);
              contender2List.setSelectedIndex(2);
              contender2List.addActionListener(new Eavesdropper2(picture2));
            //Set up the first picture.
            picture1 = new JLabel();
            picture1.setFont(picture1.getFont().deriveFont(Font.ITALIC));
            picture1.setHorizontalAlignment(JLabel.CENTER);
            updateLabel1(contender1Strings[contender1List.getSelectedIndex()]);
            picture1.setBorder(BorderFactory.createEmptyBorder(10,0,0,0));
            //Set up the second picture.
            picture2 = new JLabel();
            picture2.setFont(picture1.getFont().deriveFont(Font.ITALIC));
            picture2.setHorizontalAlignment(JLabel.CENTER);
            updateLabel2(contender2Strings[contender2List.getSelectedIndex()]);
            picture2.setBorder(BorderFactory.createEmptyBorder(10,0,0,0));
            //The preferred size is hard-coded to be the width of the
            //widest image and the height of the tallest image + the border.
            //A real program would compute this.
            picture1.setPreferredSize(new Dimension(200, 220+10));
            picture2.setPreferredSize(new Dimension(200, 220+10));
              // Create a JButton that will compute
              runButton = new JButton("Compute");
              runButton.addActionListener(new Eavesdropper3(textArea));
              // Create a JTextArea that will display the results
              textAreaLabel = new JLabel("Results");       
              textArea = new JTextArea(10,70);
              textArea.setFont(new Font("Courier",Font.PLAIN,12));
              JScrollPane scrollPane =  new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
              textArea.setEditable(false);
            //Lay out the demo.
            add(contender1List, BorderLayout.WEST);
            add(picture1, BorderLayout.WEST);
            add(contender2List, BorderLayout.EAST);       
            add(picture2, BorderLayout.EAST);
            add(runButton, BorderLayout.EAST);
            add(textAreaLabel, BorderLayout.SOUTH);
            add(scrollPane, BorderLayout.SOUTH);
            setBorder(BorderFactory.createEmptyBorder(20,20,20,20));
        /** Listens to the combo box. */
        public void actionPerformed(ActionEvent e) {
        public void updateLabel1(String name1) {
            ImageIcon icon1 = createImageIcon( name1 + ".jpg");
            picture1.setIcon(icon1);
            picture1.setToolTipText("A drawing of a " + name1.toLowerCase());
            if (icon1 != null) {
                picture1.setText(null);
            } else {
                picture1.setText("Image not found");
        public void updateLabel2(String name2) {
             ImageIcon icon2 = createImageIcon( name2 + ".jpg");
            picture2.setIcon(icon2);
            picture2.setToolTipText("A drawing of a " + name2.toLowerCase());
            if (icon2 != null) {
               picture2.setText(null);
            } else {
                picture2.setText("Image not found");
        /** Returns an ImageIcon, or null if the path was invalid. */
        public ImageIcon createImageIcon(String path) {
            java.net.URL imgURL = choice_in2.class.getResource(path);
            if (imgURL != null) {
                return new ImageIcon(imgURL);
            } else {
                System.err.println("Couldn't find file: " + path);
                return null;
        class Eavesdropper2 implements ActionListener {
            JLabel myTextArea;
            public Eavesdropper2(JLabel ta) {
                 myTextArea = ta;
            public void actionPerformed(ActionEvent e) {
                JComboBox contender2List = (JComboBox)e.getSource();
                String contender2ListName = (String)contender2List.getSelectedItem();
                updateLabel2(contender2ListName);
                Eavesdropper3 code;
                code = new Eavesdropper3(contender2ListName);
        class Eavesdropper1 implements ActionListener {
            JLabel myTextArea;
            public Eavesdropper1(JLabel tt) {
                 myTextArea = tt;
            public void actionPerformed(ActionEvent e) {
                JComboBox contender1List = (JComboBox)e.getSource();
                String contender1ListName = (String)contender1List.getSelectedItem();
                updateLabel1(contender1ListName);
        class Eavesdropper3  implements ActionListener  {
             String contender22;
            JTextArea myTextArea;
            public Eavesdropper3(JTextArea bb) {
                 myTextArea = bb;
            public Eavesdropper3(String contender2ListName){
                 contender22 = contender2ListName;
               * @return Returns the contender22.
              public String getContender22() {
                   return contender22;
            public void actionPerformed(ActionEvent e) {
                 textArea.setText("Wild Test");
                 textArea.append("\n      OUTCOME    \n\n " +getContender22());
    }

    weebib
    We are using Windows XP , Nvidia graphics card, with Multiview. I hope the problem is not specific to the platform.
    It is reproducible with 1.4.2 and absent in 1.4.1
    camickr
    I am new to this forum. didn't know about code blocks.

  • Java executeBatch() - Problem in INSERT (Order of  records not maintained)

    When we make a executeBatch() . And when the use
    select * from DUMMY_FILE_S order by ROWID
    or
    select * from DUMMY_FILE_SThe rows returned are in different order.( that is its not in the order what is inserted actually)
    And this happens once in a While.
    This is will happen only if we try many times also So please try with many INSERTs
    Please find the Java Code and the Insert SQL.
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.io.*;
    import java.sql.DriverManager;
    public class warranty_dummy
         public static void main(String args[])
                String FILENAME = "D:/data.sql";
                Connection conn = null;
                //String db_file_name_prefix = "@localhost:1531:xxxx_y14";
                   try {
                       Class.forName("oracle.jdbc.OracleDriver").newInstance();
                       // DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
                        catch (ClassNotFoundException e) {
                               e.printStackTrace();
                               //System.out.println("INSIDE class forname :"+ e.getStackTrace());
                   }catch(Exception e){
                        e.printStackTrace();
             try{
                    conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1531:yyyy_xxxx","my_user","password");
                 Statement stmt = conn.createStatement();
                   BufferedReader in = new BufferedReader(new FileReader(FILENAME));
                 String line = in.readLine();
                 System.out.println("Line " + line);
                  while(line != null) {
                 System.out.println("Line 1" + line);
                   stmt.addBatch(line);
                 line = in.readLine();
                 System.out.println("Outside While");
                 in.close();
                 int iarray[] = stmt.executeBatch();
                 System.out.println("Count" + iarray.length);
                 catch (Exception e ){
                         System.out.println("Error attempting to store results for batch " + e.getMessage());
                     } finally {
                         try {
                             conn.commit();
                             conn.close();
                         } catch (Exception se) {
                             System.out.println("Error attempting to store results for batch "+ se.getMessage());
    }SQL Data sample
    INSERT INTO DUMMY_FILE_S (FILE_NO,S_NO) values (44444,'123456789')
    INSERT INTO DUMMY_FILE_S (FILE_NO,S_NO) values (44444,'567891234')
    INSERT INTO DUMMY_FILE_S (FILE_NO,S_NO) values (44444,'333333333')
    INSERT INTO DUMMY_FILE_S (FILE_NO,S_NO) values (44444,'323232323')

    Thanks for your prompt reply.
    If we even use ORDER BY clause, we still don't get the records in the order what we inserted.
    And we see that the problem is in smt.executeBatch(); is not inserting the records the way its inserted
    For Example.
    if we insert
    INSERT INTO MyTable (SERIAL_NUMBER, DESCRIPTION ) VALUES (1,"test1");
    INSERT INTO MyTable (SERIAL_NUMBER, DESCRIPTION ) VALUES (2,"test2");
    INSERT INTO MyTable (SERIAL_NUMBER, DESCRIPTION ) VALUES (3,"test3");
    INSERT INTO MyTable (SERIAL_NUMBER, DESCRIPTION ) VALUES (4,"test4");Note : (Using smt.executeBatch();)
    After that when we use
    Select * from MyTable ORDER BY ROWIDFor some time we get the result of the query as ( In the order we Insert )
    SERIAL_NUMBER, DESCRIPTION
    ==========================
    1,test1
    2,test2
    3,test3
    4,test4And For some time we get the result of the query as ( We don't get the records in the order we Insert )
    SERIAL_NUMBER, DESCRIPTION
    ==========================
    1,test1
    3,test3
    2,test2
    4,test4Is there any work around for this?
    Thanks in advance

Maybe you are looking for

  • What are the tables for PS datasource.

    HI ALL, I am new to PS module , I got the Data source , infocube and details from help.sap.com but i want to know the exact flow on the r3 side. which table values come to data source . for eg : 0ps_dat_ntw is the data source for network dates ,so wh

  • Folder or File path when f4 option on selection screen is clicked

    can any one please let me know if there is a function module which can fetch folder name form the directory path when f4 option of selection screen field is selected. Currently I am able to get the file name using FM F4_DXFILENAME_4_DYNP but the requ

  • Search by file size in Spotlight

    I want to find all of the "Large" files on my drive to do some house cleaning. Is there a way in Spotlight to search for files larger than a certain size? I do not seem to be able to delete files from the spotlight window. I search for a file name an

  • Setting Up Share Points

    Hi All, after a huge crash I have reinstalled my system. I am attempting to set up my share points in Server Admin but am having some issues, ie folders do not show up when the server is mounted by users. Here's what I've done. Set up my users and ad

  • Best platform for Essbase

    Hi Which platform is best for Essbase, Windows 2008 R2 or Linux ?? Thanks