How to call one Main MXML from another main MXML file and pass values between them?

Hi,
I am trying to populate a datagrid from a XML file ,which I have done successful
I am able to get data out of the datagrid on clicking on any element
Now when I click on any element in datagrid I want call a new mxml file which is also have Aplication tag and I want to pass that value of clicked element to it
This is the code I am using for getting data from XML into data grid in 1st MXML file and the XML file used.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:s="library://ns.adobe.com/flex/spark"
                 xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"  initialize="exp.send()">
     <fx:Declarations>
         <s:HTTPService id="exp" url="expLab1.xml" result="
resultHandlerQuestionBar(event)"/>
     </fx:Declarations>
     <s:Panel x="74" y="218" width="485" height="333" title="Work On Configured Experiments" id="p1" fontSize="14" chromeColor="#9BFDAB" dropShadowVisible="false" contentBackgroundColor="#E4EEE6" contentBackgroundAlpha="1.0" backgroundColor="#67B6AC" textAlign="left">
          <mx:DataGrid  x="35" y="33" width="338" height="88" dataProvider="{experimentdetails}" chromeColor="#FCFCFC" contentBackgroundColor="#FFFFFF" selectionColor="#FAFBFD" rollOverColor="#FCFDFF" focusColor="#FCFDFD" itemClick="onItemClick( event );">
              <mx:columns>
                 <mx:DataGridColumn id="j1" dataField="experimentName" headerText="" itemRenderer="jaya">
                 </mx:DataGridColumn>
              </mx:columns>
         </mx:DataGrid>
     </s:Panel>
     <fx:Script>
         <![CDATA[
             import mx.collections.ArrayCollection;
             import mx.controls.Alert;
              import mx.events.FlexEvent;
             import mx.events.ListEvent;
             import mx.rpc.events.ResultEvent;
             [Bindable]
             private var workbenchname:ArrayCollection;
              //private var a:String;
             private function resultHandlerQuestionBar(event:ResultEvent):void
                experimentdetails=event.result.List.experimentList.experiment;  
             [Bindable]
             private var experimentdetails:ArrayCollection;
              private var alert:Alert;
private var data:String;
             private function onItemClick( e:ListEvent ):void {
   data= experimentdetails.getItemAt(e.rowIndex).experimentName.toString();
                alert=Alert.show(experimentdetails.getItemAt(e.rowIndex).experimentName.toString());
         ]]>
     </fx:Script>
</s:Application>
and the xml file is:
<?xml version="1.0" encoding="UTF-8"?>
<List>
   <workbench>Basic Movement</workbench>
     <experimentList>
       <experiment>
         <experimentName>Distance with varying time</experimentName>
         <Rating>2</Rating>
         <expNO>1</expNO>
       </experiment>
       <experiment>
         <experimentName>Distance with Constant time</experimentName>
         <Rating>1</Rating>
         <expNO>2</expNO>
       </experiment>
       <experiment>
         <experimentName>Time taken while decelerating</experimentName>
         <Rating>3</Rating>
         <expNO>3</expNO>
       </experiment>
      </experimentList> 
</List>
Now the code for 2nd MXML is as follows
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
      <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
      </fx:Declarations>
      <s:Label text="lable1" >
      </s:Label>
</s:Application>

Check out ExternalInterface class:
http://livedocs.adobe.com/flex/3/html/help.html?content=passingarguments_2.html
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
www.ChikaraDev.com
Flex Training and Support Services

Similar Messages

  • How sholud we call one jframe class from another jframe class

    Hi
    In my application i am calling one jframe class from another jframe clas.
    how sholud we make previous jframe inactve when another jframe is invoked?(user sholud not able to make any changes on on parent jframe window when another jframe is invoked)
    Pls reply.

    Sorry for me it is not possible to change existing code,
    pls suggest me any other solution so that i can inactive parent jframe when child jframe execution is going on.

  • How to call a Java class from another java class ??

    Hi ..... can somebody plz tell me
    How to call a Java Class from another Java Class assuming both in the same Package??
    I want to call the entire Java Class  (not any specific method only........I want all the functionalities of that class)
    Please provide me some slotuions!!
    Waiting for some fast replies!!
    Regards
    Smita Mohanty

    Hi Smita,
    you just need to create an object of that class,thats it. Then you will be able to execute each and every method.
    e.g.
    you have developed A.java and B.java, both are in same package.
    in implementaion of B.java
    class B
                A obj = new A();
                 //to access A's methods
                 A.method();
                // to access A's variable
                //either
               A.variable= value.
               //or
               A.setvariable() or A.getvariable()

  • Calling one WAD Report from another WAD Report

    Hi All,
              I want to Call one WAD report from another WAD Report and I want to show that Report in a Container of the Calling Report Itself. Kindly give the Solution. Thanks for your support in advance.
    Thanks & Regards
    Shiva

    Hi Shiva,
    There is Command called "SET_TEMPLATE" Set Web Template.
    Here you can select any of your existing web template and choose to open it in current page of in a new window.
    Hope it helps.
    Regards,
    Pratap Sone

  • How to call a rtf template from another rtf template by passing a value

    Hi Gurus,
    Its about calling a rtf template from another rtf template by passing a value.
    My requirement is like:
    I got a quote report from Siebel, based on the product PartNumber I need to pull product description or literature from another database database.
    My approach is something like; get a partnumber from quote report pass it to another rtf template which uses the partnumber and get the data from table using DataSource. When user pull a quote report from siebel this new rtf template should attach to the quote at the end.
    I've gone through all available blogs about sub-reports and white papers from Oracle they are not much helpful since I need step-by-step.
    http://www.adivaconsulting.com/adiva-blog/item/36-working-with-rtf-sub-templates.html
    bip-subtemplate-1-132933.pdf
    I'm using 10g obiee integrated with Siebel.
    Just started learning BIP.
    Thanks in advance.
    Edited by: 911927 on Apr 2, 2013 8:56 AM
    Edited by: 911927 on Apr 2, 2013 8:57 AM

    How to call a rtf template from another rtf template by passing a value try in main template create hyperlink of url with parameters for another template
    http://bipconsulting.blogspot.ru/2010/02/drill-down-to-detail-or-another-report.html
    When user pull a quote report from siebel this new rtf template should attach to the quote at the end.it'll be only another report
    IMHO you can not attach it to main. it'll be second independent report
    you can try subtemplate but it's not about rtf from rtf by click
    it's about call automatically rtf subtemplate from main rtf based on some conditions
    for example, main template contain some data and if some condition is true then call subtemplate and place it instead of its condition

  • Calling one report program from another

    Hi All,
             i am calling one report program from my program & exporting it's output to SAP-SPOOL using SUBMIT statement. I want to fetch the spool no in my program for this spool. Please guide me how this can be achieved? i have tried SYST- SPONO but it's not working.
    Thanks & Regards,
    Chetan.

    Hi,
    Initially check this it might be helpful  to u.
    http://help.sap.com/saphelp_sm40/helpdata/en/30/cc154219fce12ce10000000a1550b0/content.htm.
    Even use the function module slike Job_open , Job_close  this is also one of the methid to achive spool requests.
    Regards,
    Sana.
    Reward with points if found helpful..

  • How to call a logic package from another piece of logic

    Hello Everyone,
    I have two pieces of logic that I am running. One is a push to Finance logic that is in my payroll application (PushToFinance.lgx). It is supposed to push the data from Payroll to specific accounts within the Finance application. Within that logic I have a run logic statement that calls another piece of logic that is on the Finance application (ClearPayrollBalances.lgx). This logic is called to clear the destination application (finance) data intersections and then push the data values from Payroll to Finance. However, No matter where I put the run logic that calls the ClearPayrollBalances.LGX it clears the balances as the last step in my logic execution. I have commented it the Runlogic statement the data is pushed to the Finance application. I need to have the data intersections cleared before the Push. Any suggestions on how to make this work?
    {******************************* Push Logic Here PushToFinance.LGX *************************************
    //Planning - move data accumulated in InputorLoad member of DataSrc to the Finance App
    //Clear Finance App
    //Ran to clear data intersections in the Finance Application before Push to Finance Logic.
    *RUNLOGIC
    *APP=Finance
    *LOGIC=ClearPayrollBalances.LGX
    *ENDRUNLOGIC
    *COMMIT
    // Move Payroll Data to Finance App
    *DESTINATION_APP=Finance
    //Dims not used in Finance
    *Skip_Dim=JobTitle
    *Skip_Dim=PayPosition
    //New Dimensions in Finance
    *Rename_Dim PayAccount = AccountExp
    //Select only the accounts to be pushed to Finance
    *CALCULATE_DIFFERENCE=0 
    *Select(%PushAccnts%,"[ID]","PayAccount","FinAccount <>''")
    *XDIM_MEMBERSET PayAccount = %PushAccnts%
    *XDIM_MEMBERSET RptCurrency = LC  //only get LC in case FX conversion is used in the future
    *XDIM_MEMBERSET DATASRC = InputorLoad
    *XDIM_MEMBERSET TIME = %PREFIX%.JAN,%PREFIX%.FEB,%PREFIX%.MAR,%PREFIX%.APR,%PREFIX%.MAY,%PREFIX%.JUN,%PREFIX%.JUL,%PREFIX%.AUG,%PREFIX%.SEP,%PREFIX%.OCT,%PREFIX%.NOV,%PREFIX%.DEC                                                                               
    *WHEN DATASRC
    *IS InputorLoad
             *REC(FACTOR=1,DATASRC=PAYAPP,PayAccount=PayAccount.FinAccount)  //save to a different datasrc
    *ENDWHEN
    *COMMIT
    ********************************End Push Logic********************************
    *******************************Begin Clear Logic ClearPayrollBalances.Lgx **********************************
    //This is called from the Payroll application in the Destination  (FINANCE) App
    // Clear Payroll Balances before Payroll PushToFinance Logic populates Finance Application
    // Calling logic passes the Organization set
    *XDIM_DEFAULT ORGANIZATION=NOORGANIZATION
    *XDIM_MEMBERSET ACCOUNT=A_90020000,A_90022000,A_90030000,A_90031000,A_90031500,A_90032000,A_90032500,A_90033000
    *XDIM_MEMBERSET CATEGORY=BUDGETWORKING                                                                               
    *XDIM_MEMBERSET DATASRC=PAYAPP                                                                               
    *XDIM_MEMBERSET RPTCURRENCY=LC
    *WHEN DATASRC
             *IS PAYAPP
             *REC(FACTOR=0)
    *ENDWHEN}

    Thanks for the feedback. I figured out what you meant. I am adding it to Default logic and calling both pieces of logic from a new logic file. I am writing the steps out for others who may need it !
    1.     Create a separate logic file in Payroll called u201CPushtoFinanceu201D and add the Push section.
    2.     In your Default logic in Payroll, have two RUNLOGIC statements, first for the Finance Clear logic and then second for the Push Logic.
    *RUNLOGIC
    *APP=FINANCE
    *LOGIC=ClearPayrollBalances.LGX
    *ENDRUNLOGIC
    *RUNLOGIC
    *LOGIC=PushtoFinance.LGX
    *ENDRUNLOGIC

  • How to call an alv report from another program and return back

         Hello ,
    I am calling one abap program (Prgm B) from another program (Prgrm A).
    Here, Prgm B is an ALV report. I have fetch some data from Prgem B that gets stored in an internal table.
    Now, I am using below code in Prgrm A,
      SUBMIT Prgrm B VIA SELECTION-SCREEN
                          WITH SELECTION-TABLE rspar
                          EXPORTING LIST TO MEMORY
                          AND RETURN.
    When Prgrm A executed, it lead me to selection screen of Prgrm B and when I click F8, it shows me the report output, In short, it doesnt return back to Prgrm A. It ends up showing me the alv report if Prgrm B even afetr using RETURN statement.
    I want to get back to Prgrm A by fetching some data from Prgrm B.
    Please let me know, if i am missing something.
    Regards,
    Seema

    Hi Seema,
    Refer below code.
    DATA: v_matnr LIKE mara-matnr.
    DATA: t_listobject TYPE abaplist OCCURS 0 WITH HEADER LINE.
    DATA: t_mara TYPE mara OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_ascilist OCCURS 0,
             line(200).
    DATA: END OF t_ascilist.
    data var(3) type c.
    SELECT-OPTIONS: s_matnr FOR v_matnr.
    var = '  3'.
    START-OF-SELECTION.
       SUBMIT ztestaks1 WITH s_matnr IN s_matnr EXPORTING LIST TO MEMORY
       AND RETURN.
       CALL FUNCTION 'LIST_FROM_MEMORY'
            TABLES
                 listobject = t_listobject
            EXCEPTIONS
                 not_found  = 1
                 OTHERS     = 2.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ELSE.
         CALL FUNCTION 'LIST_TO_ASCI'
    *     EXPORTING
    *       LIST_INDEX               = -1
    *       WITH_LINE_BREAK          = ' '
           TABLES
             listasci                 = t_ascilist
             listobject               = t_listobject
           EXCEPTIONS
             empty_list               = 1
             list_index_invalid       = 2
             OTHERS                   = 3.
         IF sy-subrc <> 0.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
         ELSE.
           WRITE:/ 'Below are the lines from the submitted program.'.
           LOOP AT t_ascilist.
             WRITE:/ t_ascilist-line.
           ENDLOOP.
           SKIP 2.
         ENDIF.
       ENDIF.
       IMPORT t_mara FROM MEMORY ID 'T_MARA'.
       WRITE:/
    'Here is the output from the table exported from the submitted program.'
       LOOP AT t_mara.
         WRITE:/ t_mara-matnr.
       ENDLOOP.
    Submitted program
    REPORT  ZTESTAKS1.
    DATA: v_matnr LIKE mara-matnr,
           v_maktx LIKE makt-maktx.
    DATA: t_mara TYPE mara OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_makt OCCURS 0,
             matnr LIKE makt-matnr.
    DATA: END OF t_makt.
    SELECT-OPTIONS: s_matnr FOR v_matnr,
                     s_maktx FOR v_maktx.
    START-OF-SELECTION.
       SELECT matnr INTO TABLE t_makt
                    FROM makt
                   WHERE matnr IN s_matnr
                     AND maktx IN s_maktx.
    if not t_makt[] is initial.
       SELECT * FROM mara
                INTO TABLE t_mara FOR ALL ENTRIES IN t_makt
               WHERE matnr = t_makt-matnr.
    endif.
       EXPORT t_mara TO MEMORY ID 'T_MARA'.
       WRITE:/ 'This list is from the submitted program'.
       SKIP 1.
       LOOP AT t_mara.
         WRITE:/ t_mara-mtart.
       ENDLOOP.
    Hopes this helps you.
    Thanks,
    Ashok.

  • How to call a Dialog Program from another Dialog Program

    Dear All,
    How can I call a dialog program with return value from another dialog program?
    Regards,
    Alok.

    Hi Alok,
    1. Insted of creating 2 different Dialog program. It's good to create as many screens as you want in same module pool program. Any way you can use the different TCODE for each screen.
    2. Another and The best way is to create a function group and then inside function group use the function 2 module... In the function group define a global variable which will be present for both the function group if they are getting executed in sequence. and inside the Function Module call the screens using command " call screen <screenno>".
    3. You can use set / get parameter to pass values of a field between two dynpro program.

  • How to populate one internal table from another using field symbols

    Hi Gurus,
      I have a problem. I have to populate one internal table (sructure t_otput) from another internal table (sructure t_from) using field symbol.
    Structure for from table.
    types: begin of t_from,
             year(4) type c,
             ww(2) type c,
             site type marc-werks,
             demand type i,
           end of t_from.
    Structure for output table.
    types: begin of t_display,
             title(30),
             WW1(10),
             WW2(10),
             WW3(10),
           end of t_display.
    The from table looks like this:
    Year | WW | Site | Demand
    2005 | 1  | OR1  | 12.00
    2005 | 2  | OR1  | 13.00
    2005 | 3  | OR1  | 14.00
    The display table which has to be populated should look like this:
    Title  | WW1   | WW2   | WW3
    OR1    |       |       |
    Demand | 12.00 | 13.00 | 14.00
    How to populate display table using field symbol?
    Please give code snippets
    Thanks,
    Gopal

    Gopal,
    Here is the code, however I am not vary clear about the ORG1 and Demand display that you have shown in the display. I am sure with this code it should not be a big deal to tweak in whatever manner you want.
    TABLES : marc.
    TYPES: BEGIN OF type_display,
    title(30),
    ww1(10),
    ww2(10),
    ww3(10),
    END OF type_display.
    TYPES: BEGIN OF type_from,
    year(4) TYPE c,
    ww(2) TYPE c,
    site TYPE marc-werks,
    demand TYPE i,
    END OF type_from.
    data : t_from type table of type_from,
           t_display type table of type_display.
    field-symbols : <fs_from> type type_from,
                    <fs_display> type type_display.
    data : wa_from type type_From,
           wa_display type type_display.
    wa_from-year = '2005'.
    wa_from-ww   = '1'.
    wa_from-site = 'OR1'.
    wa_from-demand = '12.00'.
    insert wa_from  into table t_from.
    wa_from-year = '2005'.
    wa_from-ww   = '2'.
    wa_from-site = 'OR1'.
    wa_from-demand = '13.00'.
    insert wa_from  into table t_from.
    wa_from-year = '2005'.
    wa_from-ww   = '3'.
    wa_from-site = 'OR1'.
    wa_from-demand = '14.00'.
    insert wa_from  into table t_from.
    data : variable(3) type c.
    field-symbols : <fs_any> type any.
    break-point.
    Loop at t_from assigning <fs_from>.
    variable = 'WW'.
    wa_display-title = <fs_from>-site.
    concatenate variable <fs_from>-ww into variable.
    assign component variable of structure wa_display to <fs_any>.
    <fs_any> = <fs_from>-demand.
    endloop.
    append wa_display to t_display.
    clear wa_display.
    loop at t_display assigning <Fs_display>.
      write :/ <fs_display>.
    endloop.
    Note : Please award points if this helps you.
    Regards,
    Ravi

  • How to call dynamic selection screen from another report

    hi,
    i have transaction ZFAGLL03.
    it has got standard selection screen.. and dynamic selection screen...
    i am calling this transaction from another report, now how do i display this dynamic selection screen.....

    Try following code and see if it helps:
    TYPE-POOLS : rsds.
    TABLES:tgsb.
    DATA: trange TYPE rsds_trange,
           trange_line
             LIKE LINE OF trange,
           trange_frange_t_line
             LIKE LINE OF trange_line-frange_t,
           trange_frange_t_selopt_t_line
             LIKE LINE OF trange_frange_t_line-selopt_t,
              trange_line1
             LIKE LINE OF trange,
           trange_frange_t_line1
             LIKE LINE OF trange_line-frange_t,
           trange_frange_t_selopt_t_line1
             LIKE LINE OF trange_frange_t_line-selopt_t,
           texpr TYPE rsds_texpr.
    DATA: seltab TYPE TABLE OF rsparams WITH HEADER LINE,seltex TYPE rsds_texpr.
    SELECT-OPTIONS:so_gsber FOR tgsb-gsber.
    LOOP AT so_gsber.
       trange_line-tablename = 'FAGLFLEXA_FS'.
       trange_frange_t_line-fieldname = 'RBUSA'.
       MOVE-CORRESPONDING so_gsber TO trange_frange_t_selopt_t_line.
       APPEND trange_frange_t_selopt_t_line
       TO trange_frange_t_line-selopt_t.
    ENDLOOP.
    APPEND trange_frange_t_line TO trange_line-frange_t.
    APPEND trange_line TO trange.
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
       EXPORTING
         field_ranges = trange
       IMPORTING
         expressions  = texpr.
    submit FAGL_ACCOUNT_ITEMS_GL with FREE SELECTIONS texpr   AND RETURN .

  • Is it possible to call one mathscript function from another?

    HI iam bahrath..i need call the operation takin place in one mathscript in another..is it possible?pls help..

    Thanks for your concern..let me explain my project.Iam actually developing a system which provides the stress strain relationship of a material..For calculating strain which is nonlinear in this case we are using image processing techniques.We take a picture of the system initially with light markers and we find the centroid of all the markers(i use four of them).After the force is applied on the particle the centroid of the markers change as the marker positions change.I use this change in the centroid and calculate the strain.Now, 90% of the code is ready in matlab(jus capturing image and usin is needed).But i have been asked to implement it in labview.so iam tryin to put the code in mathscript and try.But the problem i face is incompatibility of many functions like imshow,input etc.so im implementin parts of the code inlabview mwthod and rest in mathscript.In matlab code i have two files and call the function in in another file from one file..thus i thought i might use two mathscripts and call one from the other..pls help.

  • How to call a Jclient form from another project?

    In my workspace, there are three projects. One is for business components. The other two are Jclient forms applications. Can I open a Jclient form from another Jclient form in another project?
    I used to create multi_form accounting application using Oracle Form Builder in which I can call a form from another form.

    Just set one project to be dependant on another in the project settings dialog of the former. This should work.

  • Navigate from report to dashboard and  pass values between different column

    Hello
    I have a question about navigating from 1 report to a dashboard page while passing the value from column 1 to column 2 in the second report...
    In OBIEE 11G, I create action link on report 1, column 1 and this action link is navigate to BI Content and the destination is a dashboard page, which has column 2 used as dashboard prompt and there are 3 reports all use column 2 to filter. Now the column 2 in the dashboard page is an alias of column 1 from report 1, from user's point of view they are the same, but from OBIEE point of view they are different.
    My action link is able to navigate to dashboard, however, the value in column 1 which I clicked to execute the navigation, does not get passed to column 2 as the dashboard prompt doesn't get this value upon navigation..
    Since I can't put column 1 in dashboard 2 nor can I put column 2 in report 1. Because our data model is done in the way that if I use column 1 or column 2 in both places, it will be circular joins...
    Is there a way around this issue?
    Let me know if I need to provide more clarification
    Thanks

    Sid
    Here is the thing..
    Let's say we have Dimension 1, dimension 2 and fact 1 and fact 2
    In one report, you need to show Dimension 2 and fact 1 so Dimension 2 joins to fact 1.
    In some other cases, you need to shown dimension 1 and fact 2 stuffs, but dimension 1 can't get to fact 2 without going through dimension 2. So Dim 1 --> Dim 2 --> Fact 2
    Then in some other cases, you need to show Dim 1 and Fact 1 reports..
    In means, your model will look at:
    Dim1 --> DIm2 and Dim 1 --> Fact 1 and Dim 2 --> Fact 1.. This is just a simpler version of a much more complex model that I am dealing with now..
    So in this case, you can't just use Dim 1 attributes across the board. For some dashboards, you will have to create alias of Dim 1, call it A1_Dim1, un-join Dim1 with Dim 2 or to fact 1 to avoid circular joins... Then in different reports, you either use columns from Dim 1 or A1_Dim1..
    Now Dim1 and A1_DIM1 are really the same thing, but they are not according to OBIEE...
    So my problem is, in report 1 where Dim1 is used, it can't past values to Dashboard 2 where A1_DIM1 is used as dashboard prompt..
    I want to know if there is a way around this issue
    Hope this makes more sense now
    Thanks

  • Calling one java program from another

    Hello,
    How can I start another java program from one? Lets
    say I want Second.java to start by calling it from
    First.java. How do I do it? The two programs are given
    below. Any help is appreciated.
    Thanks,
    Amanda
    First.java
    import java.io.*;
    import java.lang.reflect.*;
    public class  First
         public static void main(String[] args)
              Process theProcess=null;
              System.out.println("Hello World from First.java!");
              String second=new String("Second.java");
              //System.load(second);
              //Runtime.getRuntime().load(second);
              try
                   theProcess=Runtime.getRuntime().exec( "Second.java"
                   System.out.println("after exec");
              catch (IOException ioe)
                   System.out.println(">>IOException thrown in
    First.java while calling
    Second.java."+ioe.getMessage());
    Second.java
    public class  Second
         public static void main(String[] args)
              System.out.println("Hello World from Second.java!");
    }

    Thanks, warnerja
    What if Second.java is on a remote machine i.e.
    First.java and second.java are on different machines?
    Will I have to use RMI?Well, you'd have to do some kind of remote invocation. Depends on what kinds of apps house the classes. There are all kinds of ways - web services, servlets, RMI, (maybe others...)
    That's a totally different question than what you originally posted, and would have been very relevant to say so in the first place.

Maybe you are looking for