Java3D Non-Applet Example Code

Hi, i've been searching far and wide for an example of Java3D code that is NOT used inside an applet. If someone could please post the most basic elements of a Java3D program used in an application, I would greatly appreciate it. Thank you! If you know of any websites with example applications, please post those here as well.

...or add a main-method that makes your applet runnable as an application as well!
public static void main( String[] params){
    com.sun.j3d.utils.applet.MainFrame frame= new  com.sun.j3d.utils.applet.MainFrame(
        new YourApplet(), 800,600);
}

Similar Messages

  • Simple Server/Client Applet example code ???

    Hi to all.
    I would like to ask if possible to someone to tell me some example code to do this simple thing:
    I want an applet showing only a TextField and a button. When the user writes something on the textfield and press the button, it should send the text in the textfield to the "server", and then it should save it in a variable.
    I think there should be 2 different classes at least (server and client), but no idea in how could I make this on Java.
    So I am asking if possible for some sample code for make this.
    Thank you for the information
    John

    hello!
    Here is a console based Server which will recieve the string and disply on the DOS screen.
    /////////////////////////////////// Server /////////////////
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class ChatServer extends Thread
    ServerSocket ssSocket;
    Socket sSocket;
    public BufferedReader in;
    public PrintWriter out;
    public ChatServer()
         try
         ssSocket = new ServerSocket (4000);
         catch(IOException e)
         System.out.println (e);
    public void run()
    try
         sSocket = ssSocket.accept();
         if(sSocket != null)
              in = new BufferedReader(new InputStreamReader(sSocket.getInputStream()));
              out = new PrintWriter(sSocket.getOutputStream(), true);
    String str = in.readLine();
         System.out.println (str);
         catch(IOException e)
              System.out.println (e);
    public static void main (String []args)
              Thread th = (Thread) new ChatServer();
              th.start();     
    ///////////////////////// Client //////////////////////
    public class Client extends Applet implements ActionListener
    public Socket sClient;
    public BufferedReader in;
    public PrintWriter out ;
    String str;
    private TextField txt = new TextField();
    private Button btn = new Button ("OK");
    public void init()
         try
         sClient = new Socket ("localhost" , 4000);
         in = new BufferedReader(new InputStreamReader(sClient.getInputStream()));
         out = new PrintWriter(sClient.getOutputStream(), true);
         catch (UnknownHostException uhe)
         catch (IOException ioe)
         System.out.println (" I/O Exception : " + ioe);
         setLayout(new FlowLayout());
         txt.setColumns (20);
         add(txt);
         add(btn);
         btn.addActionListener(this);
    public void actionPerformed(ActionEvent AE)
         if(AE.getSource() == btn)
         str = txt.getText();
         out.println(str);
    now u should try it and improve it according to ur need...
    Ahmad Jamal.

  • Is there example code for using Ni488 and PCI-GPIB card in non controller mode?

    Is there example code for using Ni488 and PCI-GPIB card in non controller mode?

    cymrieg,
    Your code looks good to me. What is the problem? What happens when it fails? What is the IBSTA value on the controller, and at what point in the code does it stop? What is the IBSTA value on the slave, and at what point does it stop?
    One thing is that you might not want to call IBCLR() in a loop on the device. At the beginning of the program is fine...This will send a clear command to the device and will clear out any LACS and TACS bits that might be set. Also your IBDEV call shouldn't be in a loop.
    Hope this helps, but let me know if you need more information.
    Scott B.
    GPIB Software
    National Instruments

  • [svn] 4595: Fix for - Example code in ObjectProxy ASDoc page is incorrect

    Revision: 4595
    Author: [email protected]
    Date: 2009-01-20 08:11:25 -0800 (Tue, 20 Jan 2009)
    Log Message:
    Fix for - Example code in ObjectProxy ASDoc page is incorrect
    Also modify the build.xml for "ant asdoc"
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-18335
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18335
    Modified Paths:
    flex/sdk/trunk/asdoc/build.xml
    flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectProxy.as

    >
    build url like this,
    '<a href=f?p='||NV('APP_ID')||':45:'||V('APP_SESSION')||'::NO:RP,45,CIR:ub_branch,ub_supplier,ub_customer,ub_product,ub_aging,ub_destination:'||REPLACE(branch,' ','%20')||'%2C'||REPLACE(ub_supplier,' ','%20')||'%2C'||REPLACE(ub_customer,' ','%20')||'%2C'||REPLACE(ub_product,' ','%20')||'%2C'||REPLACE(ub_aging,' ','%20')||'%2C'||REPLACE(ub_destination,' ','%20') ||'>All</a>',All of this is handled by the apex_util.url_encode API function as described above.
    However, as also mentioned above, the best approach is to only pass discrete key values in URLs.

  • [svn] 3968: Fix for - ASDoc fails if example code included by the @ includeExample tag contains an "&"

    Revision: 3968
    Author: [email protected]
    Date: 2008-10-30 10:45:04 -0700 (Thu, 30 Oct 2008)
    Log Message:
    Fix for - ASDoc fails if example code included by the @includeExample tag contains an "&"
    Also fix for broken links with $$ symbol.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-17830
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17830
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocUtil.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

    Revision: 3968
    Author: [email protected]
    Date: 2008-10-30 10:45:04 -0700 (Thu, 30 Oct 2008)
    Log Message:
    Fix for - ASDoc fails if example code included by the @includeExample tag contains an "&"
    Also fix for broken links with $$ symbol.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-17830
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17830
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocUtil.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

  • Is anyone have an example code on CAN Periodic Transmission

    I'm looking for an example code for a CAN periodic transmission in Labwindows CVI, because the example deliver with NICAN is not interesting for me.
    If anyone have an example code,

    Hi Lilian,
    The Obj2Obj.c example shows how to configure a CAN object for periodic Tx (one frame each second).
    In this case, the write queue length is set to 0, which means that the last written value is transmitted. You can set a non-zero queue length to transmit a set of frames.
    DiegoF
    National Instruments.

  • Server/Client applet sample code ???

    Hi to all.
    I would like to ask if possible to someone to tell me some example code to do this simple thing:
    I want an applet showing only a TextField and a button. When the user writes something on the textfield and press the button, it should send the text in the textfield to the "server", and then it should save it in a variable.
    I think there should be 2 different classes at least (server and client), but no idea in how could I make this on Java.
    So I am asking if possible for some sample code for make this.
    Thank you for the information
    John

    here is code for applet..
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    public class MyApplet extends Applet
          implements ActionListener {
      TextField tf;
      Button btn;
      public void init() {
        setLayout(null);
        tf = new TextField();
        tf.setBounds(5,5,80,20);
        btn = new Button("send message to server");
        btn.setBounds(5,30,150,20);
        btn.addActionListener(this);
        add(tf);
        add(btn);
      public void actionPerformed(ActionEvent ae) {
        sendMessage();
      void sendMessage() {
        String msg = tf.getText().trim();
        tf.setText("");
        if(msg==null) return;
        try {
          // this is using a direct socket connection..
          Socket s = new Socket("www.blah.com",80);
          ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(s.getOutputStream()));
          oos.writeObject(msg);
          oos.flush();
          ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(s.getInputStream()));
          String response = (String) ois.readObject();
          System.out.println("response received="+response);
          ois.close();
          oos.close();
          s.close();
        } catch (Exception e) {
            System.out.println("error in sendMessage:"+e);
    }here is the html code..
    <applet code=MyApplet width=180 height=55></applet>
    let me know if u need more help.
    good luck.

  • API & Example Code License Question

    Note: This is a repost from this thread on Forum Nokia. I was referred here by Ron Liechty, a Forum Nokia Online Community manager. Please keep that in mind to avoid circular bureaucracy. Thanks
    tl;dr: I want to use Nokia PC Connectivity API 3.2 example code as base for an open source project.
    I am considering to spend some time on implementing that long overdue sync solution between Nokia PC Suite and Mozilla Sunbird/Lightning (making this a Windows-only solution, but thats what i, and probably a few other people, need). My current plan would be to write a plugin for Sunbird, and a C++ glue code .dll that is [scriptable] via the Mozilla XPConnect interface and heavily based on the PIMNavigator example application packaged with the Nokia PC Connectivity API 3.2. Nokia has placed the following license on this piece of source code:
    Copyright (c) 2007 Nokia Corporation.
    This material, including but not limited to documentation and any related
    computer programs, is protected by intellectual property rights of Nokia
    Corporation and/or its licensors.
    All rights are reserved. Reproducing, modifying, translating, or
    distributing any or all of this material requires the prior written consent
    of Nokia Corporation. Nokia Corporation retains the right to make changes
    to this material at any time without notice. A copyright license is hereby
    granted to download and print a copy of this material for personal use only.
    No other license to any other intellectual property rights is granted. 
    Since this would require me to, err, print out all the code in that very handy Visual Studio project and start coding from scratch, I would like to request a writ of consent from Nokia to use the example code as base for my work.
    If I go ahead with it, I will release my product as open source and free of charge (not forgoing a Paypal donate button, but still), so the license I'd like to request is to a private person and for developing a non-profit product. After looking around on Forum Nokia, I haven't been able to locate the right place to apply for this kind of license, thus I'm asking for pointers from the community here. Replies from Nokia officials are highly appreciated as well, of course
    I had a brief chat with a german Nokia support callcenter agent, who was convinced that Forum Nokia would be the place to go to with questions of this type. If that is indeed the case, I would very much like to be directed to a specific person / email address, if possible.
    Message Edited by krugar on 06-Aug-2009 02:22 PM

    Hi,
    have you tried to search in SDN for "mdm api example". I found this: <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/2d18d355-0601-0010-fdbb-d8b143420f49">Introduction to the SAP Master Data Management Java API - Presentation</a>.
    Regards
    Gregor

  • Question on the example code 8253eventcount.c

    Hi.
    I saw the example code 8253eventcount.c before in the NI-DAQ6.9.x. That is very useful.But i still confuse that "Do i need to set up each clock pulse duration?". From the program, it seems that the counting process solely depends on the function NIDAQDelay(sec).....
    By the way, if i am now using an old version of NI-DAQ6.8.5, How can i update some calculated voltages for each 1ms. Although i have read and followed the procedures in the user mannual of lab-pc+,but, i am still not sure how to program the counterA2 with appropriate update interval. Could anyone give me an example code? It seems that no examples are given in the version of NI-DAQ6.8.5.
    I am now using lab-pc+ with Ni-daq6.8.5 by using c++ and win
    dows95 as my working platform.Please help me in anyway! Thanks!
    Attachments:
    Lab_PC+_AO.cpp ‏2 KB

    The NIDAQDelay() is only in there to control how often the program checks the current count on the counter. If it is set to 1 seconds, it will read the counter every one second and return how many counts have been read since the start. If you take that function out, the program will check the counter as fast as it can which will tie up your CPU.
    As to your question about calculated voltages, can you be more specific as to what your application is and what you are trying to do, I'm a little confused.
    Brian

  • Acrobat 7.0 ActiveX Object example code in Lookout

    Help folks!
    I'm trying to set up the Adobe Acrobat 7.0 Browser Document ActiveX Object under Lookout 6.0 but it doesn't work. My goal is to display a pdf document by lookout.
    What should I set by Property Browser...?
    What should I set by Property Pages...?
    What should I set by Value Property:?
    What means the term "Property" in this kind of objects?
    Is there an example code I can get?
    Any suggestion will be appreciated.
    Thanx.

    I don't know of a FREE ActiveX control for MS Word.  However, if you have MS Word installed on the same computer, you can use MS Internet Explorer ActiveX Control to view Word documents. 
    But before we do that, we have to make sure that MS Word is set to open documents in the "same window."  This basically opens a DOC file in Internet Explorer itself rather than launching a new MS Word window and then opening the DOC file in it.  To set this (if it isn't already):
    1. Launch Windows Explorer. 
    2. From the Tools menu, select "Folder Options"
    3. Click the "File Types" tab. 
    4. From the listing of "Registered File Types," select "Microsoft Word Document," (you can get to it fast by typing "DOC"); click Advanced. 
    5. Click the "Browse in same window" check box -- this toggles whether a Word document is launched outside of Internet Explorer. 
    6. Click OK to close the dialog boxes. 
    NOTE:  if the DOC still opens in a new MS Word window (and not IE), go back and toggle the check-box. 
    In Lookout, use the Lookout Webbrowser control (which is nothing but MS IE Control).  Specify the file path to the DOC file as the URL.  I am attaching a process file which does this using a TextEntry object. 
    Hope this helps.
    -Khalid
    PS:  not sure when this changed but we can't directly attach .L4P files to a post.. what a pain!  Please take a minute to add your weight to this request: 
    http://forums.ni.com/ni/board/message?board.id=130​&message.id=2142
    Message Edited by Khalid on 12-28-2005 02:55 PM
    Attachments:
    doc_process.zip ‏4 KB

  • While creating OpenDirectory replica, I get a "non-zero status code". How do I fix this?

    I'm trying to create an OpenDirectory replica with OS X 10.9.2 servers running Server 3.1.1. The server seems to connect to the master momentarily, but ultimately the connection fails. The log file shows:
    May 21 11:25:01 inglewoodmirror.local Server[323]: An error occurred while configuring InglewoodMirror as a directory replica:
    Error Domain=XSActionErrorDomain Code=69 "Server returned a non-zero status code"
    UserInfo=0x608000a73500 {NSLocalizedDescription=Server returned a non-zero status code}
    The Apple Discussion titled, "Error occurred creating OD replica" addressed the issue by running Workgroup Manager to backup users, before destroying and recreating the OD.  However, that user also botched the master-replica relationship by changing the host name of the master without destroying the replica's first.
    I'm hoping that there is a simpler method to solve this issue.  It is my understanding that Workgroup Manager is a depricated app, so I am hesitant to use the method recommended by the referenced solution.
    What causes this error?  How can one attempt to remedy this without destroying the master?

    Update
    I have been trying to diagnose this by analyzing the network traffic, which has been enlightening, but it suddenly dawned on me that I had not checked the "Logs" section of the Server application.  Checking the Log and changing the specific Log to "Configuration Log" in the OpenDirectory section, I see the following:
    This error is much more clear than the text described above.  It seems that the problem is not network communication, rather it is that the OpenDirectory administrator is not the same as the system administrator.  I had thought that the user account was one and the same.
    So, now the question becomes.....
    How do I determine the userId of the directory administrator?
    The password is known.  We have a standard password that we use in this company for such things, but the user account is not known.  That changes based on the machine which houses the directory.  Does anyone have a suggestion?

  • Has anyone got the Comsoft Profinet example code working??

    Hello!
    I have a cRIO Profinet card and I'm attempting to get the example code working.
    I have followed the instructions in GettingStarted_cRIO_PN_IO_Device.pdf
    I have created an empty project with just the 9023 and 9113 present, and copied the 3 items from the example project cRIO PN IO-Device (LV 2012) as per the documentation.
    When I try to compile I get the error shown attached.  I cannot view the error as the VI is password protected.
    In 5 years of working with cRIO using many different c-series modules from NI and 3rd parties I have never come across a password protected example Vi - this is very disappointing!  I don't see how it will be possible to use the card without being able to access this VI, and clearly it is impossible to use it without this VI as they are unwilling to share its functionality.
    Has anyone got this working on anything other than a 9104 (which the example uses?)  Does anyone know the password?  Is it possible to use the card without using this example code?
    I will be communicating with a Siemens PLC (acquiring a load of U16s and logging on the cRIO at 20ms intervals).
    Many thanks for any input, or any experiences of using this card.
    Aaron
    LabVIEW/RT/FPGA 2012
    NI-RIO 12.0.1
    cRIO 9023 controller and 9113 chassis with COMSOFT PN module in slot 1.
    Attachments:
    PN_error.png ‏44 KB
    PN_error2.png ‏20 KB

    Just for the record, I am using the CRIO-PN with cRIO-9081 and cRIO-9068 integrated chassis successfully.
    LabVIEW (RT/FPGA) 2013 SP1.
    I didn't use the higher level ComSoft example code directly, as the VIs use so many control/indicators that the FPGA usage is sky high. I rewrote them to pass the I/O data via DMA FIFOs.

  • Incoming payments - payment on account example code for 8.8

    Hi
    Would anyone have example code for SAP B1 8.8 of an incoming payment - payment on account example please
    Thanks
    Regards Andy

    Hi Ed
    Thanks
    I actually had a problem with my own code but it turned out someone gave me the wrong gl code to use !
    Thanks again
    Regards Andy

  • Non Dedutable tax code issue

    Hi Gurus,
    I have one issue, User Created PO with non dedutable tax code and Did GR and while doing IR
    Invoice Account Details
    Posting        Accounting        G/L Code             Act/ mat/Ven             Amount
    1                   K                        220000               Vendor code               5050.02-
    2                   S                        230000                GR/IR Clearing Acc     4449.39
    3                   M                        110950               Material code               600.66
    Issue is tax amount is 600.66, Why it is posting Accounting Key M as this is non dedutable tax code, so as per my understanding
    System shoud post 600.66 to GR/IR clearing account, so why it is posting to M.
    Please suggest where it is went wrong?
    Anil

    hi,
    as in your case you are not availing the cenvat credit, instead you are loading the same on the inventory as you could not avail it.hence the system has loaded the cenvat credit on the material that why you are getting sepearte line item in the accounting doc.
    in the tax procedure you would have assign NVV accounting key against the condition type. you define the details of NVV in OBCN trx where you would have mentioned as seperate line item(2) against the posting indicator. if you have maintained (3) against the posting indicator then it would distribute the expense /revenue item.i.e nothing but your GR/IR account
    Regards,
    velu

  • None exist error  code after a graceful shutdown

    I'd like to return a none zero exit code after a normal graceful shutdown.
    My end task is to be able to send a restart event to a number of machines running my application that will gracefully shutdown and inform the shell script that started it that it wants to be restarted.
    One option would be System.exit with a shutdown hook that monitors the current threads, and does not end until the other threads have also exited, but I would have to inform this hook of threads that should be allowed to finish naturally. But that seams a little [t]icky.
    I guess I could write to a file, and then close down naturally. But this leaves files drifting about. I'm not overly keen on that either.
    Any other suggestions? Thanks, Mike

    The "worker" thread should
    not be interupted, and told to exit, just left to
    exit under there own steam. (when they have finished
    the current job). What is the "worker" thread ? Is it what I meant with "watcher" thread ? Is that what you said or what I said ?
    And, I assumed we are talking about a server-like application, that is one running indefinitely, as opposed to one that would perform a specific task and then terminate. Am I correct ?
    The initalization of this new type of
    shutdown/restart is currently undefined, but will
    likely that the application start listening on a
    socket connection. I'm sorry, I don't understand that at all.
    I want this to ease deployment,
    currently when I deploy a new version I type "ant
    deploy", then VNC on to each of the computer
    (currently just 3, but likely to be more soon) and
    manually restart. What I want is to just type "ant
    deploy" it sends a signal to the running copies, and
    they restart themselfs. (I'm a lazy brsatard).You know this quote by Larry Wall (?) about the three most important characteristics of a programmer, don't you ?
    >
    and thus the exit code is already defined.Not so with what I would consider a "graceful
    shutdown". Then the application would shut down as
    all the threads have completed.It depends on whether having "all threads completed" is a normal part of the application's flow. If I assumed correctly we were talking about a server-like app, then it's not. Ergo the command to terminate has to be issued at some point. The question is how that gets done. For instance, if you send a CTRL-C from the shell, your application shuts down with an error code != 0.
    A graceful shutdown needs to be initiated somewhere. How do you plan to do it ?

Maybe you are looking for

  • Multiple domains names and web sites with only one SLS and one static IP

    I tried to find a post on this topic but I still can't find what needs to be done. SLS is configured for one domain with one web site and it's working well. We will call it domain1.com. Here is the config: Static IP: 69.x.x.x DNS setting under Server

  • V20 firmware for n95 8gb

    hi excuse my ignorance but what does the v20.0.016 update give you apart from crashing ngage, now sorted, cant find anything obvious. thanks steve...have vodafone branded n95 8gb.

  • ITunes Application Error When Attempting to Turn on Genius

    I am using the latest version of iTunes and QT. After I log in with my Apple ID, iTunes starts to gather info about my library and then I get this error and iTunes crashes. [IMG]http://img205.imageshack.us/img205/6310/clipboard01c.jpg[/IMG] By petrag

  • Connecting Oracle DataBase through WebDynpro

    Hi, I created a Dynamic table, now I should display the data from Oracle Database. I tried in many various ways to connect to database, but the data is not retrieving. Can u explain the reasons and give necessary coding to retrieve the data. Its very

  • Pages not showing up for free

    Hi, I'm having trouble getting Pages downloaded om my iPad Air for free. Downloading the other two iWork apps went just fine. Before I had all three of the iWork apps on my iPad, using my husband's Apple ID. Now I want the apps being connected to my