How to invoke Matlab from Java

Hi, I want to pass some data generated from Java class to Matlab, then invoke Matlab from Java to run the computation program (file written in Matlab, myfile.m). I know Matlab can use classes generated from Java, how to drive Matlab from Java?
I appreciate your help!
yaya

According to their documentation, you can't. Having said that, again according to their documentation, there are plans to support this in future releases.
m

Similar Messages

  • How to invoke javafx from java code

    hi all,
    i'm trying to invoke my .fx class from java class, but getting exception.
    Exception thrown in JavaFX pretty printing: java.io.FileNotFoundException: \tmp\___FX_SCRIPT___.fxdump from StringInputBuffer (The system cannot find the path specified)
    Exception thrown in JavaFX pretty printing: java.io.FileNotFoundException: \tmp\___FX_SCRIPT___.fxdump from StringInputBuffer (The system cannot find the path specified)
    javax.script.ScriptException: compilation failed
    at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.parse(JavaFXScriptEngineImpl.java:255)
    at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.eval(JavaFXScriptEngineImpl.java:145)
    at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.eval(JavaFXScriptEngineImpl.java:136)
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
    at myclockproject.Main2.main(Main2.java:34)
    I read in article http://java.sun.com/developer/technicalArticles/scripting/javafx/javafx_and_java/ about including javafxc.jar in classpath .. could some one tell me what classpath he meant, i have included it in my environment variable and also project libraries .. still getting error :(

    coolsayan.2009 wrote:
    thanx.is communication api required?but is the communication api available for windows?its available for linux and sparc??Are you referring to the COMM API that is referenced in the first link when you google - the one entitled "How to Send SMS using Java Program (full code sample included)"? If so, Here: [http://java.sun.com/products/javacomm/|http://java.sun.com/products/javacomm/]
    what to do in serverside?is any change required in web.xml or any jndi setup in serverside if i call the java class from a jsp page?I don't know, are you planning on making your class available through JNDI?

  • [HELP] How to invoke BPEL from JAVA program via calling WSDL?

    Dear all,
    Customer want to invoke BPEL process in their Java program by calling BPEL WSDL, but not successfully.
    Does BPEL support this calling way? If so, would pls give a sample?
    BTW, they do not want to use API of OraBPEL.jar.
    Thanks in advance.

    Krishna, Not sure what you mean by 'normal' web service....I mean, is BPEL service not normal, is it not as per WS standards. It would be interesting if you could shed some light on that.
    On the question of calling BPEL, I thought there were two methods - one is using the BPEL PM API, which uses the locator class to get hold of BPEL PM instance and then call a deployed bpel service
    The other way is to develop a web service proxy using JDeveloper. Its a very simple process. Once you do that, you can call the proxy from Java.

  • How to invoke browser from java program in Solaris ?

    Hi all,
    Is there any way by which a browser can be opened with specific URL, from a java program in solaris OS ?
    In windows I am able to do so by using "rundll32 url.dll,FileProtocolHandler".
    Thanks,
    ngs

    Well, how is a browser normally invoked on Solaris? And have a look at JDIC, maybe it helps you.

  • How to invoke dll from Java applications

    Hello Friends,
    I am new to JNI application and I never tested it before. Now I have to interact with dll�s
    Which is running on AS400 machines. Currently our application, which is mainly retrieving the data and passing some parameter to the dll�s through Delphi application.
    There are two dll�s called
         1) Client side dll - to make the connection with server side dll.
         2) Server side dll � to deal all server side operations.
    Now, I have to write the interface in java to interact with client side dll and I have to display the values on browser.
    If any one did this kind of application give guidance for me
    Thanks in advance.
    Selvin.

    look for those applications/keywords
    JNI (java native interface)
    jactivex

  • How to Link to MATLAB from java?

    Hi
    Anyone knows how to link to MATLAB from java? I am programming in Java (Eclipse) and I want to link to MATLAB.
    Thanks,
    Bing

    Hi, there:
    Will using JTable add much overhead? I may have to use several JTables and switch among them. I can add scroll bar to or edit JTables, right?
    BTW, do you have experience about gnuplot? Can I find the command tree of gnuplot somewhere? Or do you know a better place to post question about gnuplot? unix/linux group, maybe.
    Thanks,
    Jack
    P.S. Would you guys answer my question after I use up my duke dollars? :- )

  • Jintegra problem - accessing Matlab from Java??

    Hi:
    Sorry if this post doesn't belong here!!
    I am accessing Matlab from JAVA using JIntegra for COM. I tried running the example in their website.
    (http://j-integra.intrinsyc.com/support/com/doc/other_examples/Matlab.htm)
    I have also posted the example below. I am using their trial version and have included all the jars as said. I get the an unexpected output (all zero's) for reading a variable in the matlab workspace. I don't understand why I get this. Can anyone let me know if this runs for you??
    Thanks
    Pavan
    Example code from Jintegra website:
    public class MatlabExample {
    public static void main(java.lang.String[] args) throws Exception {
    try {
    // DCOM authentication: Make sure NT Domain, NT User, NT Password are valid credentials.
    // Uncomment this line if MatlabExample.java remotely accesses MATLAB :
    // com.linar.jintegra.AuthInfo.setDefault("NT DOMAIN", "NT USER", "NT PASSWORD");
    // Create the MATLAB object
    // Specify host name or IP address of MATLAB machine as parameter if
    // MatlabExample.java remotely accesses MATLAB.
    // mlapp.MLApp mlApp = new mlapp.MLApp("123.456.789.0");
    mlapp.MLApp mlApp = new mlapp.MLApp();
    String result = mlApp.execute("a = [1 2 3 4; 5 6 7 8;]");
    System.out.println("Execute result is " + result);
    double mreal[][] = new double[2][4];
    double mimage[] = new double[0];
    mlApp.getFullMatrix("a", "base", new Object[]{mreal}, new Object[]{mimage});
    for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 4; j++) {
    System.out.println(mreal[i][j]);
    } finally {
    com.linar.jintegra.Cleaner.releaseAll();
    }

    ......How are you declaring the class in your JSP? ... are you instantiating it as a bean using the useBean tag, or just instantiating it in your code like normal.
    Maybe you could post the relevant JSP code too?
    Hello again,
    Only the last string is populating after the file has be tokenized. What I'll like to accomplish is passing the very first string in the file. I did not get too far in the JSP file setup because the code is still in it's testing stage, but any help will be highly appreciated.
    Here is the JSP code
    <%@page import="dev.*" %>
    <%@page session="true" language="java" import="java.io.*" %>
    <jsp:useBean id="wagerhist" scope="request" class="dev.RoundDetail2" />
    <html>
    <head>
    <title>Round Detail</title>
    <body>
      <table width="530" bordercolor="#000000" valign="top">
        <tr>
              <td align="left"  width="19%">Game ID<%=wagerhist.string_gameID%></td>
              <td align="left"  width="30%">  </td>
              <td align="left"  width="20%">card1</td>
              <td align="left"  width="31%">  </td>
            </tr>
      </table>
    </body>
    </html>

  • Calling Matlab from Java

    Hi everybody,
    I need to call Matlab from Java, run some programs in matlab and get the standard output.
    I know I can start matlab with:
    Process proc = Runtime.getRuntime().exec("matlab");
    But then how do i run a program in matlab? (For example, if I have "myprogram.m", I would run it in matlab by typing "myprogram")
    If I start a new process [Process proc2 = Runtime......exec("myprogram")], it does not start in matlab.
    Any ideas?
    thanx in advance.

    Sounds like myprogram is just a parameter of a call to matlab.
    Try some variations on
    exec("matlab myprogram");
    There is also - I believe - an exzec call that takes an array of parameters.

  • How to initiate process from Java?

    Hello,
    Does anyone knows how to initiate Process from java code???
    or Which API can start a new instance of Business process??

    If you are on Oracle BPM 10g, here's a link to a thread on this forum that might also help. It is a step-by-step.
    Creating a new work item instance in a process using PAPI
    Dan

  • Invoke BPEL from Java for 11g

    I searched the forum and here's the code for 10g
    Trying to Invoke BPEL from JAVA
    I'm using 11g, do you know if the way to invoke BPEL is the same as 10g? If not, do you know what the differences are?
    Thanks,
    Andy

    I got the below errors when I try to call a composite in 11g. I wrote it in a simple java program and run it within jdeveloper. I'm using the adf binding. When I passed in an empty NormalizedMessage object then it worked fine. But when I passed in the payload data then I got the errors below. It did create an instance on my soa server but the instance did not call the pbel process. Do you have any ideas?
    StringBuffer inputPayload = new StringBuffer();
    inputPayload.append("<ns1:process xmlns:ns1=\"http://xmlns.oracle.com/BPELScheduler/LineItemProcessEventList\">");
    inputPayload.append("<ns1:input>test</ns1:input>");
    inputPayload.append("</ns1:process>");
    Locator locator = LocatorFactory.createLocator(jndiProps);
    Composite composite = locator.lookupComposite("default/BPELScheduler!1.0");
    Service service = composite.getService("lineitemprocesseventlist_client_ep_java");
    NormalizedMessage input = new NormalizedMessageImpl();
    input.getPayload().put("payload",inputPayload);
    service.post("process",input);
    ============ ERROR ========================================
    oracle.fabric.common.FabricInvocationException: java.rmi.RemoteException: EJB Exception: ; nested exception is:
         java.lang.RuntimeException: oracle.fabric.common.FabricInvocationException
         at oracle.soa.management.internal.facade.ServiceImpl.post(ServiceImpl.java:106)
         at com.masyc.scheduler.BPELDriver.callBpel(BPELDriver.java:54)
         at com.masyc.scheduler.BPELDriver.main(BPELDriver.java:24)
    Caused by: java.rmi.RemoteException: EJB Exception: ; nested exception is:
         java.lang.RuntimeException: oracle.fabric.common.FabricInvocationException
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:223)
         at oracle.soa.management.internal.ejb.impl.FacadeFinderBean_4vacyo_FacadeFinderBeanImpl_1031_WLStub.executeServiceMethod(Unknown Source)
         at oracle.soa.management.internal.ejb.EJBLocatorImpl.executeServiceMethod(EJBLocatorImpl.java:875)
         at oracle.soa.management.internal.facade.ServiceImpl.post(ServiceImpl.java:98)
         ... 2 more
    Caused by: java.lang.RuntimeException: oracle.fabric.common.FabricInvocationException
         at oracle.soa.management.internal.ejb.impl.FacadeFinderBeanImpl.executeServiceMethod(FacadeFinderBeanImpl.java:866)
         at sun.reflect.GeneratedMethodAccessor2796.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
         at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
         at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy238.executeServiceMethod(Unknown Source)
         at oracle.soa.management.internal.ejb.impl.FacadeFinderBean_4vacyo_FacadeFinderBeanImpl.executeServiceMethod(FacadeFinderBean_4vacyo_FacadeFinderBeanImpl.java:1610)
         at oracle.soa.management.internal.ejb.impl.FacadeFinderBean_4vacyo_FacadeFinderBeanImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: oracle.fabric.common.FabricInvocationException
         at oracle.fabric.CubeServiceEngine.post(CubeServiceEngine.java:538)
         at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:142)
         at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:194)
         at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:204)
         at sun.reflect.GeneratedMethodAccessor1043.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
         at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy195.post(Unknown Source)
         at oracle.integration.platform.blocks.sdox.JavaEntryBindingComponent.post(JavaEntryBindingComponent.java:250)
         at oracle.soa.management.internal.ejb.impl.FacadeFinderBeanImpl.executeServiceMethod(FacadeFinderBeanImpl.java:864)
         ... 30 more
    Edited by: user8742475 on Nov 10, 2009 1:39 PM

  • How to invoke A CORBA-Java Client Application, from Oracle???

    Hi,
    I have a CORBA-Java Client Application, which takes the input parameters from a Oracle table and calls the CORBA Server, passes these parameters to the C++ Server Application and gets the results back thorugh CORBA.
    My problem is, this java application needs to be invoked, when ever there is a new record in the Oracle table.
    I am not sure if i can use Java Stored Procedures in Oracle in this case, because my app is in Sun JVM and i am using BEA WebLogic Enterprise 5.1 for the CORBA.
    Is there any other way by which i can invoke this app, when a new record is updated in the Oracle table?
    Currently, i have just put a TIMER in my java App, to check the oracle table in every few seconds, to see if there is a new reocrd. If it finds a new record it invokes the corresponding class(corba class), or else just keep sending a messsage that no new record is available.
    The problems i am facing in this method are as follows;
    1. Unnecessarily, the application has to keep on running if there is no request coming frequently.
    2. When there is a new record found, the Corba Class is called and the whole process (till it gets the result back from the server) takes about 20 - 30 secs. But within this period, if there is another record coming into Oracle table, my timer class doesnt invoke another corba class....(though i am using multithreading by using the RemidTask method in the timer.schedule.
    (timer.schedule(new RemindTask(),10,5*1000);)
    3. Also, if during the first call, there is some error, then the whole process exits, instead of another process running parallely (when a second new record is found).
    So how does this timer class act like a multithreading process?
    Well, i hope i am not confusing....Please let me know if anyone wants bit more elaboration on this.
    It would be really helpful if someone can suggest some answer to my problem.
    Thanks in advance.

    Thank you very much Keith.
    Though i am really getting a hope of solving this problem, from you answer, i am actually not 100% sure if i understood your reply properly.
    First of all, about
    1. "use the update stored procedure to place the updated record (or unique index) onto an Oracle Application Queue."
    -- Why do i need to put the record in the AQ. (Frankly speaking, at this moment i dont have much idea about AQ, probably i can learn more about it from oracle technet site? Or would u suggest anything else?)
    Then,
    2."Your app then waits on this queue and for each new message, consumes it, gets the data required from the AQ load (e.g the index and or record), and fires off the CORBA class"
    -- How does my application stay in the queue? and gets the data from the queue?
    Of course, as far as i understand, i am going through the same principle...keeping on running a timer class, which keeps on checking the table for a new record, and when it finds, it calls the CORBA class.
    Of course, i feel there should be a difference in running the timer continuosly and staying in queue. However i am totally unaware, how can i make my java app to wait in the queue and waits for a new record?
    Can you please elaborate your answer a bit more, because i dont know about the AQ, that you have mentioned.
    Thank you very much in advance for your time. But please know that it will be of great help to me and hence will be higly appreciated.
    Regards,
    Subhasree.

  • How to Invoke Extensions in Java Concurrent Programs - Urgent

    hi all,
    can any one help me in understanding how to invoke Extensions (attached to Rules) in Java Concurrent Programs (part of autoconfig)
    it is migration task from FC to Extensions
    Please suggest
    thanks,
    Srikanth

    if you want to invoke the rule, that triggers the Extension, create a rule which invoke the rule, like "ALWAYS TRUE" REQ Extension. Then as soon as the Model in instaniated, the Extension will be executed.

  • Trouble to invoke BPEL from Java Client following rmi example

    I still have troubles to invoke my BPEL process from Java Client by following tutorial sample of 102.InvokingProcesses/rmi .
    I created my Java class within NetBeans IDE. And the following line of code return null for url,
    java.net.URL url = ClassLoader.getSystemResource("context.properties");
    I think that I need to have SystemResource set up somewhere, how should I do that?

    if you using oc4j.. then please make a small change in oc4j_context.properties
    from
    java.naming.provider.url=[java.naming.provider.url]
    to
    java.naming.provider.url=ormi://hostname/orabpel
    And please make sure the context.properties file which gets copied to classes/context.properties has this above entry. For more details please refer to build.xml under rmi folder.
    Please do let me know if you face any issue.

  • How to invoke method from swing

    Aloha,
    Thanks in advance for help...
    I have created GUI, and want to use buttons to choose which Physics problem to solve. I have already coded the Physics in .java and have different methods for each one. I would like for the button to create an action that places the different problems on the panel, each with a section for information, given input and outputting the answers to solve for.
    public void actionPerformed(ActionEvent e)
         { // [20]
               String actionCommand = e.getActionCommand();
               if (e.getActionCommand().equals("Quiz 1"))
                 Quiz1();
               }Quiz1 is a private void method that calls on a helper method to perform calculations.
    When I use the above command, it invokes the method, but not on the GUI panel, it comes up on the DOS screen. What command should I use to place the calculations and information for this method on the GUI? I know I need to separate and create areas of the panel for input, etc. But I want the method to take place on the GUI.
    Thank you for your time and energy.

    Hi - I have a question now regarding using a single button, to collect data from multiple fields, make calculations and then return figures to multiple fields.
    I thought I could read them into two different variables (valueIn, valueIn2, etc) and then apply them to the JTextField variables. I was experimenting with just passing the initial figures without making calculations...
    But just trying with two different fields, the compiler gives me an error for an "unreachable statement". How do I collect from multiple sources and return separate answers to different fields?
    I tried to look up definitions for compiler messages, but couldn't find anything regarding "unreachable statements". Therefore, I would also appreciate any suggestions about a dependable source to reference errors.
    Thank you in advance for your assistance, I am attaching copy of code below...
    public class ChoiceFrame extends JFrame implements ActionListener
    { // [1]
         SolveIt converter = new SolveIt();
         public static final int WIDTH = 650;
      public static final int HEIGHT = 500;
      private JTextArea infoText;
      private double valueIn = 0;
      private double valueIn2 = 0; 
      private JTextField cliffHt;
      private JTextField deceleration;
      private JTextField timeFlight;
      private JTextField height;
      public static void main(String[] args)
      { // [2]
              ChoiceFrame myWindow = new ChoiceFrame();
              myWindow.setVisible(true);
         } // [2]
         public ChoiceFrame()
         { // [3]
              super( );
              setSize(WIDTH, HEIGHT);
              setTitle("ChoiceFrame");       
              Container contentPane = getContentPane();
              contentPane.setBackground(Color.BLUE);
              contentPane.setLayout(new BorderLayout());
              addWindowListener(new WindowDestroyer());                     
              JMenu memoMenu = new JMenu("File");
        JMenuItem file;
        file = new JMenuItem("Clear");
        file.addActionListener(this);
        memoMenu.add(file);
        file = new JMenuItem("Exit");
        file.addActionListener(this);
        memoMenu.add(file);
        JMenuBar mBar = new JMenuBar( );
        mBar.add(memoMenu);
        setJMenuBar(mBar);     
              JPanel northPanel = new JPanel();   
              northPanel.setLayout(new BorderLayout());          
              JPanel textPanel = new JPanel();          
        northPanel.add(textPanel, BorderLayout.WEST);       
              infoText = new JTextArea (8, 43);
              infoText.setBackground(Color.WHITE);
              infoText.setLineWrap(true);
              textPanel.add(infoText);
        infoText.setText("The Coyote, in his relentless attempt to catch the elusive Road Runner,\nloses his footing and falls from a sheer cliff ___ meters above the ground.\nAfter falling for __ seconds (without friction), the Coyote remembers that\nhe is wearing his Acme rocket-powered backpack, which he immediately turns on.\nThe Coyote makes a gentle landing (zero velocity) on the ground below,\nbut is unable to turn off the rocket, and is immediately propelled back up into the air.\n___ seconds after leaving the ground, the rocket runs out of fuel.\nAfter continuing upwards for a ways, the poor Coyote plunges back to the ground.");
              JPanel inputPanel = new JPanel();          
        northPanel.add(inputPanel, BorderLayout.EAST);      
              inputPanel.setLayout(new GridLayout(3,2));     
              cliffHt = new JTextField(5);
              inputPanel.add(cliffHt);
              JLabel mtrsLabel = new JLabel("meters");
              inputPanel.add(mtrsLabel);
              JTextField secondsf = new JTextField(5);
              inputPanel.add(secondsf);
              JLabel sfLabel = new JLabel("seconds falling");
              inputPanel.add(sfLabel);
              timeFlight = new JTextField(5);
              inputPanel.add(timeFlight);
              JLabel sFlightLabel = new JLabel("seconds in flight");
              inputPanel.add(sFlightLabel);          
              JPanel southPanel = new JPanel();          
              southPanel.setLayout(new BorderLayout());          
              JPanel buttonPanel = new JPanel();
              buttonPanel.setLayout(new FlowLayout());
              JButton calcButton = new JButton("Calculate");
              calcButton.addActionListener(this);
              buttonPanel.add(calcButton);
              southPanel.add(buttonPanel, BorderLayout.NORTH);
              JPanel outputPanel = new JPanel();
           outputPanel.setLayout(new GridLayout(3,2));          
              JLabel decelLabel = new JLabel("With the rocket backpack turned on, the deceleration is: ");
              outputPanel.add(decelLabel);
              deceleration = new JTextField(10);
              outputPanel.add(deceleration);
              JLabel htLabel = new JLabel("the max height is: ");
              outputPanel.add(htLabel);
              height = new JTextField(10);
              outputPanel.add(height);
              JLabel vLabel = new JLabel("the velocity is: ");
              outputPanel.add(vLabel);
              JTextField velocity = new JTextField(10);
              outputPanel.add(velocity);          
           southPanel.add(outputPanel, BorderLayout.CENTER);
              contentPane.add(northPanel, BorderLayout.NORTH);                         
              contentPane.add(southPanel, BorderLayout.CENTER);     
         } // [3]
         public void actionPerformed(ActionEvent e)
         { // [20]
              String actionCommand = e.getActionCommand();
              if (e.getActionCommand().equals("Calculate"))
                        deceleration.setText(Quiz1());
                        height.setText(Quiz1());
              else if (e.getActionCommand().equals("Close"))
                   System.exit(0);
              else if (actionCommand.equals("Exit"))
          System.exit(0);
         } //[20]
         private String Quiz1()
         { // [40]
              SolveIt calculate = new SolveIt();
              double gravity = 9.81;
              double initialSpeed = 0;
              double freeFall = 5; //this is time for freefall in seconds
              valueIn = stringToDouble(cliffHt.getText());
              return Double.toString(valueIn);     
              valueIn2 = stringToDouble(timeFlight.getText());          
              return Double.toString(valueIn2);
         } // [40]     
         private static double stringToDouble(String stringObject)
         { // [30]
              return Double.parseDouble(stringObject.trim());
         } // [30]

  • Call MatLab from Java

    Hi Java Lovers,
    Any one know how to call MatLab function from Java Code

    {color:#ff0000}Triple posted{color}
    [http://forum.java.sun.com/thread.jspa?threadID=5280633]
    [http://forum.java.sun.com/thread.jspa?threadID=5280629]
    Cross posting is rude.
    db

Maybe you are looking for

  • How do I import AVI video with stereo audio (and keep it that way)?

    Today I just discovered that all the AVI video with stereo audio I've ever imported into a Premiere Pro CS6 project has been mysteriously converted to mono. And I can't find any import setting anywhere that enable me to change this. Here's the deal..

  • Photo library has become unreadable

    I recently upgraded my Mac to OS-X 10.9.4. When opening Iphoto, I now get the message that photo library is in use by another program, or has become unreadable. I tried to rebuild the library, doesn't work. I have tried to install previous version of

  • When I execute my download for Itunes windows comes back with the error file does not exist verify it

    The following error message comes up every time I run the Itunes installer package. "This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a

  • Odbc connectivity problem

    Hi all, when i am installing ECC 5.0 i got below error. "odbc connectivity problem, error executing sql command" what may be the reason. plz give me some solution. vinnu.

  • HyperLinkText in Crystal Report

    Hello, I have a hyperlinktext in a report which worked in previous versions. Now when I click the hyperlink at runtime he doesn't show all of the parameters. This is what is filled in in the property HyperLinkText of the report: CRdefault.aspx?report