Copy values from one Parent node to other Parent Node

Hi all,
I have a 2 Parent node each having 3 child nodes. I want to copy the values of all the attributes of all the child nodes of one Parent Node to corresponding other node.
Both the Parent Nodes as well as their Child Nodes have different name but their attributes have same name.For ex:
Parent Node -A
Child Nodes - a, b,c
Child Node "a" has attributes "x" and "y"
Parent Node -B
Child Nodes - d,e,f
Child Node "d" has attributes "x" and "y" .
Now I want to copy the values od attributes "x" and "y" from one Parent Node to other Parent node.
Please help me out.
Helpful answers will be rewarded.
Thanxs in advance...

Hi Jin,
To use copy service API, u need to satisfy 2 condition for the attributes of source node and target node:
1. The name of the attribute should be same (including the case of the name)- Abc is different from ABC
2. Type of the attribute should also be the same.
copy elements works for copying values from Model node to context and does not work vice-versa. To enable the copying of context node to model node, use copycorresponding API.
Eg:
int contextNodeSize = wdContext().node<contextNodeName>().size();
for(int i = 0; i < contextNodeSize; i++)
     <modelNodeName> modelObject = new <modelNodeName>();
     <contextNodeName>Element contextObject = wdContext().node<contextNodeName>().get<contextNodeName>ElementAt(i);
     WDCopyService.copyCorresponding(contextObject, modelObject);
This will copy the values from Context Node to Model Node.
Hope this helps you.
Regards,
Poojith MV

Similar Messages

  • Copying value from one cursor to another

    Hi,
    I have a problem while copying values from one cursor to another cursor.
    The code looks like below.
    PROCEDURE XYZ
                TransactionResultSet OUT NOCOPY types.ref_cursor,
    IS
                temp_cursor types.ref_cursor;
                wip_rec types.ref_cursor;
    BEGIN
    DECLARE
                    CURSOR temp_cursor IS
                SELECT ...........
    END;
    BEGIN     
        FOR wip_rec IN temp_cursor
        LOOP
        update tinsagr set something
        where {the condition}
            IF SQL%ROWCOUNT = 0 THEN
      dbms_output.put_line('this is test ');
            Fetch wip_rec into TransactionResultSet;
         END IF;
       END LOOP;so basically i want to iterate the "temp_cursor" and depending on the values i get it from here i shall update a table. Actually i want to exclude few records from "temp_cursor" and add it/copy rest of the records to "TransactionResultSet"
    That means say initially " temp_cursor" has 100 records and i updated 5 records in a table and same number of records should be excluded and rest should be added to the output cursor TransactionResultSet.
    How do i achieve it?
    while saving i am getting
    (1): PLS-00456: item 'WIP_REC' is not a cursor.
    Do any one has any idea what to do in such scenario?

    There are options like....
    SQL> CREATE OR REPLACE TYPE emp_obj AS OBJECT (ename VARCHAR2(50), dept NUMBER);
      2  /
    Type created.
    SQL> CREATE OR REPLACE TYPE emp_tbl IS TABLE OF emp_obj;
      2  /
    Type created.
    SQL> set serverou on
    SP2-0158: unknown SET option "serverou"
    SQL> set serverout on
    SQL> DECLARE
      2    rc      sys_refcursor;
      3    v_ename emp.ename%TYPE;
      4    v_dept  emp.deptno%TYPE;
      5    ---End Of Local Varriable Declaration
      6    --Procedire declaration !
      7    PROCEDURE TEST_CUR(pi_out_ref_cur IN OUT sys_refcursor) IS
      8      emp_rec emp_tbl;
      9    BEGIN
    10      /* This BULK COLLECT can be done with explicit cursor,Ref Cursor
    11      with some simple modification, Here I have used implicit cursor! */
    12      SELECT emp_obj(ename, deptno) --Casting as the object
    13      BULK COLLECT
    14        INTO emp_rec
    15        FROM emp
    16       WHERE deptno = 10;
    17   
    18      dbms_output.put_line('Records selected are:');
    19      FOR i in 1 .. emp_rec.COUNT LOOP
    20        dbms_output.put_line(emp_rec(i).ename || '--' || emp_rec(i).dept);
    21      END LOOP;
    22      --Now we are filtering the record and may be doing some operation with each record.
    23      FOR i in 1 .. emp_rec.COUNT LOOP
    24        IF emp_rec(i).ename = 'KING' THEN
    25          --You can change this IF according to your need.
    26          emp_rec.DELETE(i);
    27        END IF;
    28      END LOOP;
    29      OPEN pi_out_ref_cur FOR
    30        SELECT * FROM TABLE(emp_rec); --Using the TYPE AS table.
    31    END TEST_CUR;
    32    /* Main execution or procedure calling section*/
    33  BEGIN
    34    --Actual calling
    35    TEST_CUR(rc);
    36    dbms_output.new_line;
    37    dbms_output.put_line('Now in Ref Cursor');
    38    dbms_output.put_line('****************');
    39    LOOP
    40      FETCH rc
    41        INTO v_ename, v_dept;
    42      dbms_output.put_line(v_ename || '--' || v_dept);
    43      EXIT WHEN rc%NOTFOUND;
    44    END LOOP;
    45 
    46  END;
    47  /
    Records selected are:
    CLARK--10
    KING--10
    MILLER--10
    Now in Ref Cursor
    CLARK--10
    MILLER--10
    MILLER--10
    PL/SQL procedure successfully completed.
    SQL>

  • How do i copy stickies from one mac to the other

    how do i copy stickies from one mac to the other?
    or are they stored in a file i can just copy them over ? if so what is the file name path?
    thanks in advance

    yes, they are stored in the file /users/username/library/StickiesDatabase. just copy it over to the corresponding location on the new computer.

  • OSB : How can we copy  actions from one project folder to other projects?

    How can we copy actions from one project folder to other projects in OSB?
    For eg:
    I have a service call out action in Project1/proxySer1
    I want to copy this to Project2/proxySer2.
    Espicially, in our case error handling callout is common to all of our projects and we should be able to copy from one to another.
    Edited by: user10367892 on Aug 20, 2009 12:28 PM

    Thank you for the reply.
    It was my fault. I was on two different servers, while i was doing this and so didn't work. But copy /past action works as you suggested.
    Can I select multiple actions from one stage and paste to different proxy service? I have too many options to copy/paste and hence I have this question.
    Is there any other way of copying all selected actions in one stage to another, but not the complete stage itselft?

  • I have a new iMac and i created two libraries on iTunes. how do i copy songs from one library to the other?

    I have a new imac. I created two libraries, one for me, one for my kids. how do I copy songs from one library to the other library?

    Not easy unless you're just content with adding some files to the other as new files but lose playlists for those files, and playcount, and ratings, etc.  If you're okay with that, you can drag the media folder from one library to the other. If you use default settings and want to duplicate the media, just drag it. If you want to add the media but leave it where it is currently located, hold down the option key while dragging to the library window.
    Otherwise:
    PowerTunes - http://www.fatcatsoftware.com/powertunes/ (commercial software)
    syncOtunes - http://homepage.mac.com/oligrob/syncOtunes/syncOtunes.html

  • How to copy data from one planning area to other planning area

    Hi ,
    I need to copy data from one planning area to other planning area, the MPOS for two planning areas are differant and  here my scenario is one planning area having extra key figures.
    First i need to release forecast data to CIP planning area and then,  i load the data from infocube  to MPS planning area and copy the data from CIP planning area. here both MPS and CIP planning areas having different MPOS .
    Please help me in this. Please give me the stepls i need to follow.
    Thanks in advance.
    Regards,
    Chandu

    Hi,
    You can use the transaction /sapapo/tscopy.
    In this you can configure your source plng area and destination plng area. You also have an option to map your KF. There is no problem if the MPOS are different as long as you are able to map the characteristics between the 2 MPOS.
    Alternatively, you can create an Infocube which shares common ground between the 2 planning areas and extract data from CIP plng area into the infocube and then copy teh data from infocube to MPS plng area using the the transaction /sapapo/tscube.
    Hope this helps.
    Thanks
    Mani Suresh

  • How to copy value from one field to another in a Apex Form

    Hello guys,
    There are 2 addresses one is shipping and other is billing. I do not want the customer to re-enter all the details if it is the same address. So based upon an action, it should take the live values from one address field and populate the other address field. I know in JS you can do it, but how to implement that in Apex?
    I guess using Dynamic Actions to achieve this in Version 4 but do not know how. Read quite some info but no luck.
    Thanks in advance!

    Hi,
    I have assumed that you have your shipping address at the top of the page, and then further down the page you have your billing address that you want to enable the users to copy (if this is in reverese, you will need to switch the js variables in the code following).
    I would create a Select List item above the 'Billing Address' details, called PX_SAME_ADDRESSThis select list would be static, with the options Null.
    I also assume you would have pairs of address page items such as:
    PX_SHIPPING_ADDRESS_L1
    PX_BILLING_ADDRESS_L1
    PX_SHIPPING_ADDRESS_L2
    PX_BILLING_ADDRESS_L2
    PX_SHIPPING_POST_CODE
    PX_BILLING_POST_CODEThen copy the following code into the HTML Header of the page definition:
    <script language="JavaScript" type="text/javascript">
    function copyAddress()
       if( $x('PX_SAME_ADDRESS').value == 'YES')
         $x('PX_BILLING_ADDRESS_L1').value = $x('PX_SHIPPING_ADDRESS_L1').value;
         $x('PX_BILLING_ADDRESS_L2').value = $x('PX_SHIPPING_ADDRESS_L2').value;
         $x('PX_BILLING_POST_CODE').value = $x('PX_SHIPPING_POST_CODE').value;
       else //Clear Address Fields
         $x('PX_BILLING_ADDRESS_L1').value = " ";
         $x('PX_BILLING_ADDRESS_L2').value = " ";
         $x('PX_BILLING_POST_CODE').value = " ";
    </script>Then, in your PX_SAME_ADDRESS item, copy the code below into the Element > HTML Form Element Attributes field.
    onChange="copyAddress();"Hopefully this works for you too, and should give you some basis to play around with.
    Amanda.

  • IPOD 4GB can i copy music from one IPOD to the other

    I have tried doing this but it comes up with your not authorised .

    You can't copy directly from one iPod to another, the songs have to be transferred to iTunes first and your second iPod is updated from there. The transfer of purchased content from the iPod to authorised computers was introduced with iTunes 7. A paragraph on it has been added to this article: Transfer iTunes Store purchases using iPod
    The transfer of content from other sources such as songs imported from CD is designed by default to be one way from iTunes to iPod. However there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod. You'll find that they have varying degrees of functionality and some will transfer movies, videos, photos, podcasts and games as well. Have a look at the web pages and documentation, this is just a small selection of what's available, they are generally quite straightforward. You can also read reviews of some of them here: Wired News - Rescue Your Stranded Tunes
    TuneJack Windows Only
    iPod2PC Windows Only
    iGadget Windows Only
    iDump Windows Only
    iRepo Windows Only
    iPodRip Mac & Windows
    YamiPod Mac and Windows Versions
    Music Rescue Mac & Windows
    iPodCopy Mac and Windows Versions
    There is also a manual method of accessing the iPod's hard drive and copying songs back to iTunes on Windows or a Mac. The procedure is a bit involved and won't recover playlists but if you're interested it's available at this link: Two-way Street: Moving Music Off the iPod

  • Can i copy values from one object to another ?

    One more help..
    How do i compare the input values with the ones in an object of another class ?
    Can i copy values of one object of a class to different object of another class ?
    Thanks,
    Sanlearns

    How do i compare the input values with the ones in an
    object of another class ?By getting and comparing them?
    Can i copy values of one object of a class to
    different object of another class ?Yes, you can. But you shouldn't, as you're breaking encapsulation all over the place. You could use setter methods (if available) to set the values.

  • How to use value from one data set in other data set SQL select.

    Hello all, i have one data set, and i need to get value from that data set into other data set. Something like '?' but without input. I will try to explain it with screenshots:

    If both tables come from the same data source, join the two tables in one data set rather than two as shown. If they are from different data sources, use a 'join data set'

  • Copy value from one field in subform, to another field in a different subform

    Hi all.  I have been back and forth with enterprise support, and they are telling me what I want to do is impossible.  I find that hard to agree with, so hoping I can get some help here.  I have a document that I am creating, based off an XML.  The page consists of a header subform, a flowing table of variable name, and then a footer.  My problem comes in, that when the table flows to mutliple pages, my header subform will not repeat, even though I have it set as the overflow header.  According to Enterprise Support, this is by design.  The header will repeat on the footer page, if that is on a separate page, just not when the table flows to another page.  So, I came up with a solution to create an additional Header in my table, merge all the cells into one column, and copy my subform into that new header.  I would set that header to appear only on subsequent pages.  So, when I preview my document, it shows the static text fine, as I would expect, however the text fields are blank.  I need a way of copying the values from the original header subform, into the newly created table header subform.  The values will be different based on teh XML input, meaning that the first 3 pages will have one set of values, and the next 3 another, etc..  See sample below...
    <NameValueList>
         <NameValue>
              <NameValueName>Name1<NameValueName>
              <NameValueDesc>Desc1<NameValueDesc>
               <TableValueList>
                   <TableValue>
                        Blah
                   </TableValue>
                   <TableValue>
                        Blah 2
                   </TableValue>
              </TableValueList>
         </NameValue>
         <NameValue>
              <NameValueName>Name2</NameValueName>
              <NameValueDesc>Desc2<NameValueDesc>
              <TableValueList>
                   <TableValue>
                        Blah 5
                   </TableValue>
                   <TableValue>
                        Blah 6
                   </TableValue>
              </TableValueList>
         </NameValue>
    </NameValueList>
    So, if I bind my original header to NameValueName, it will show on the first page which has my header, and the third page that has my footer.  But my 2nd page, that has the table flowed to it, has a blank value.  I tried to put code in the Initialize event of both text boxes, to copy from MainHeader.NameValueName to TableHeader.NameValueName, but that didn't work properly. 
    Any ideas on how to do this?

    Thank you very much for the reply.  I tried putting the copy statement in both the MainHeader and TableHeader initialize events.  There was different behavior, depending on the place I put the copy statement, however neither was correct.  If I put it in the initialize of the TableHeader, the NameValueName that appears on other page is Name1.  Even though the header shows Name2 when it hits the next nodes.  If I put it in the initialize of MainHeader, nothing is copied on the proper table header pages.
    I initially had Master pages, however that really didn't work.  The master pages traversed the NameValueName nodes on it's own loop.  So, Each page displayed the next value in it's own loop, when the main subform loop is still showing data from the previous value.  I know this might be hard to understand, but I'm doing my best to explain.  THanks again for your reply, and I hope that there is another idea out there to fix this...

  • Copying Queries from one infoset to the other with variants

    Hello Gurus,
    I have two infosets (A & B) based on logical database PNPCE. Infoset A & B are exactly the same. Now, I want to copy the queries of infoset A to infoset B.
    I am unable to copy the queries with variants. And I am getting following message:
    Error when copying query report XXXXXXX= with variants. Error when importing query
    FYI, I am able to copy the queries without variants successfully, using 'Sap Query: Special Copy Functions'.
    Any help on this would be much appreciated.
    Thanks,
    Ikram

    I think you are right. I see  now that I am overcomplicating things.
    To answer your question, no I do not add any color adjustments to the individual compound clips. I double click into the compound clips and make color adjustments to each of the angles from the multicam clip. When copying a clip made from the same multi cam clip from one project to another, any color adjustments made to the angles of that multicam clip that was copied over from the other project, does not carry over to the same multicam clips to the new project it was copied to - even if you break the compound clip apart to just the multicam clip, at least that's what I've noticed.
    But as you said, the easier thing to do, and this makes total sense now, would be create your multicam clip, and use keywords to label the parts in the browser, then drag the clips to the timeline as you need them. I'm assuming that the color corrections you apply to the angles on the timeline will be automatically applied to new keyword clips you drag to the timeline? Also, to name those multicam clips on the timelines, would you use markers? Is this correct?
    I really need to watch a few online tutorials on compound clips, but what Luis said has really cleared things up for me.
    Thanks so much for your help and patience guys!

  • Best way to copy table from one database to any other database

    I need to write an application to perform database table copy from one kind of database to another kind of database.
    I just wrote a simple JDBC program which essentially does the something like below:
    PreparedStatement statement = null;
    ResultSet rs = null;
    try
    System.out.println("insertSQL:" + insertSQL.toString());      
    statement = target.prepareStatement(insertSQL.toString());
    System.out.println("selectSQL:" + selectSQL.toString());
    rs = source.executeQuery(selectSQL.toString());
    int rows = 0;
    while (rs.next())
    rows++;
    for (int i = 1; i <= columns.size(); i++)
    statement.setString(i, rs.getString(i));
    statement.execute();
    System.out.println("Copied " + rows + " rows.");
    But problem with this one is that it takes lot of time( more than 60 mins) for 100k records transfer. Would there be any faster way to do this?
    TIA...

    Thanks...
    I am using now batch update mechanism and set the fetchsize of resultSet cursor.
    Now I need to copy a table with almost 10 million records to the target database. My program works fine but it takes more than 3 hours.
    I am copying from Postgres table to MS SQL server table.
    Is there any other way or more better appraoch to make this more faster?
    TIA..

  • Help needed to Copy Queries from one User Favorites to other

    Hi Experts,
    We have one requirement to copy Queries from favorites of one user to other,But issue that while i am trying this in sandbox for any new user it is working with SE 37 Function module -FAVOS_EVENT_ADD_TO_USER_SHELF Approach then Queries are visble on Favorites on USER MENU.
    And for any other existing user if we use this Function Module ,Queries saved to fav are not visible in USER MENU screen although it is visible in TABLE SMEN_BUFFC.
    Please advice on this.
    Thanks
    Nilesh

    Hi,
    Use FNDLOAD.
    Note: 364558.1 - How To Use FNDLOAD To Download Responsibilities With All Security Groups, Not Just STANDARD
    Note: 735338.1 - Tips About FNDLOAD
    FNDLOAD responsibility
    FNDLOAD responsibility
    use FNDLOAD to download the profile setup for a responsibility
    use FNDLOAD to download the profile setup for a responsibility
    Thanks,
    Hussein

  • How to copy value from one frame to another frame

    Hi,
    I am new to swing prgramming .
    I have created a menu called " TopFrame " and it contains toplevel menu item "select" and select Menu contains subitems "firstframe", "secondframe", "thirdframe" and "Exit".
    When i click select->firstframe it displays a new Frame f1 with a
    textfield t1. I enter value in textfield t1 and minimise the frame.
    similarly when i click select->secondframe it displays a new Frame f2 with a textfield t1. I enter value in textfield t1 and minimise the frame.
    now when i click select->thirdframe it displays a frame f3 which contains button called "Totalvalue" and a textfield t2 .
    MY question is after opening frame f3 when i press "Totalvalue" button it should add the values from textfield t1 from both the frames f1 and f2 and display the result in textfield t2 of frame f3.
    Actually my application is big but for better understanding i have reduced the description above.
    I am posting the code...Kindly help me
    thanks in advance..
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Component;
    import java.awt.Checkbox;
    import javax.swing.*;
    import java.text.DecimalFormat;
    import javax.swing.JComponent;
    public class MainWindow extends Frame {
      public MainWindow() {
        super("TopFrame");
        setSize(600, 600);
        // make a top level File menu
        FileMenu fileMenu = new FileMenu(this);
        // make a menu bar for this frame 
        // and add top level menus File and Menu
        MenuBar mb = new MenuBar();
        mb.add(fileMenu);
        setMenuBar(mb);
        addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            exit();
      public void exit() {
        setVisible(false); // hide the Frame
        dispose(); // tell windowing system to free resources
        System.exit(0); // exit
      public static void main(String args[]) {
        MainWindow w = new MainWindow();
        w.setVisible(true);
        w.setBackground(Color.white);
    private static MainWindow w ;
    protected TextField t1, t2;
      class FileMenu extends Menu implements ActionListener {
      private MainWindow mw; // who owns us?
      private MenuItem itm1   = new MenuItem("Firstframe");
      private MenuItem itm2   = new MenuItem("Secondframe");
      private MenuItem itm3   = new MenuItem("Thirdframe");
      private MenuItem itmExit = new MenuItem("Exit");
        public FileMenu(MainWindow main)
        super("Select");
        this.mw = main;
        this.itm1.addActionListener(this);
        this.itm2.addActionListener(this);
        this.itm3.addActionListener(this);
        this.itmExit.addActionListener(this);
        this.add(this.itm1);
        this.add(this.itm2);
        this.add(this.itm3);
        this.add(this.itmExit);
      public void actionPerformed(ActionEvent e)
        if (e.getSource() == this.itm1)
         final Frame f1 = new Frame("first frame opened");
         f1.setSize(500,500);
         f1.setLayout(null);
         Label l1 = new Label("Enter first value below");
         l1.setBounds(220, 250, 240, 24);
         f1.add(l1);
         TextField t1 = new TextField("0");
         t1.setBounds(260, 300, 40, 24);
         f1.add(t1);
          f1.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e)
              //System.exit(0);
               f1.dispose();
         f1.show();
       else
       if (e.getSource() == this.itm2)
         final Frame f2 = new Frame("second frame opened");
         f2.setSize(500,500);
         f2.setLayout(null);
         Label l1 = new Label("Enter first value below");
         l1.setBounds(220, 250, 240, 24);
         f2.add(l1);
         TextField t1 = new TextField("0");
         t1.setBounds(260, 300, 40, 24);
         f2.add(t1);
          f2.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e)
              //System.exit(0);
               f2.dispose();
         f2.show();
       else
       if (e.getSource() == this.itm3)
         final Frame f3 = new Frame("third frame opened");
         f3.setSize(500,500);
         f3.setLayout(null);
         JButton b1  = new JButton("Totalvalue");
         b1.setBounds(220, 300, 180, 24);
         f3.add(b1); 
         TextField t2 = new TextField("0");
         t2.setBounds(410, 300, 40, 24);
         f3.add(t2);
         f3.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e)
              //System.exit(0);
               f3.dispose();
         f3.show();
       else
       { mw.exit();}

    hi ,
    I have extended my application ...i have some doubts can you please clear my doubts..
    Now i have two textfields t1 and t2 in both the frames frame 1 and frame 2 and i have 2 buttons Button1 and Button2, textfields t5 and t6 in frame3.
    Now my question is i enter some values in t1 and t2 in frame1, and t1 and t2 in frame2 and minimise or close them...when i open frame3 and press Button1 it should take values from t1 in both frame1 and frame2 , add them and display the result in t5( in frame3)... similarly when i press Button2 it should take values from t2 in both frame1 and frame2, add them and display the result in t6(in frame3).
    Can you please tell me how can i do this?
    Thanks in advance.
    I am posting the code...
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.Component;
    // Make a main window with a top-level menu: File
    public class MainWindow extends Frame {
        public MainWindow() {
            super("Test Window");
            setSize(500, 500);
            // make a top level File menu
            FileMenu fileMenu = new FileMenu(this);
            // make a menu bar for this frame
            // and add top level menus File and Menu
            MenuBar mb = new MenuBar();
            mb.add(fileMenu);
            setMenuBar(mb);
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    exit();
        public void exit() {
            setVisible(false); // hide the Frame
            dispose(); // tell windowing system to free resources
            System.exit(0); // exit
        public static void main(String args[]) {
            w = new MainWindow();
            w.setVisible(true);
        private static MainWindow w ;
        protected TextField t1, t2,t5,t6;
        // Encapsulate the look and behavior of the File menu
        class FileMenu extends Menu implements ActionListener {
            private MainWindow mw; // who owns us?
            private MenuItem itmPE   = new MenuItem("ProductEvaluation");
            private MenuItem itmPRE   = new MenuItem("ProcessEvaluation");
            private MenuItem itmTE   = new MenuItem("TotalEvaluation");
            private MenuItem itmExit = new MenuItem("Exit");
            public FileMenu(MainWindow main) {
                super("File");
                this.mw = main;
                this.itmPE.addActionListener(this);
                this.itmPRE.addActionListener(this);
                this.itmTE.addActionListener(this);
                this.itmExit.addActionListener(this);
                this.add(this.itmPE);
                this.add(this.itmPRE);
                this.add(this.itmTE);
                this.add(this.itmExit);
            // respond to the Exit menu choice
            public void actionPerformed(ActionEvent e) {
                if (e.getSource() == this.itmPE) {
                   final Frame frame1 = new Frame("Frame1");
                    frame1.setSize(700,700);
                    frame1.setLayout(null);
                    t1 = new TextField("");
                    t1.setBounds(230, 230, 50, 24);
                    frame1.add(t1);
                    t2 = new TextField("");
                    t2.setBounds(330, 230, 50, 24);
                    frame1.add(t2);
                    frame1.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                            frame1.dispose();
                    frame1.setVisible(true);
                else
                if (e.getSource() == this.itmPRE) {
                  final  Frame frame2 = new Frame("Frame2");
                    frame2.setSize(700,700);
                    frame2.setLayout(null);
                    t1 = new TextField("");
                    t1.setBounds(230, 230, 50, 24);
                    frame2.add(t1);
                    t2 = new TextField("");
                    t2.setBounds(330, 230, 50, 24);
                    frame2.add(t2);
                    frame2.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                            frame2.dispose();
                    frame2.setVisible(true);
                else
                if (e.getSource() == this.itmTE) {
                  final  Frame frame3 = new Frame("Frame4");
                    frame3.setSize(700,700);
                    frame3.setLayout(null);
                    t5 = new TextField("");
                    t5.setBounds(170, 230, 50, 24);
                    frame3.add(t5);
                    t6 = new TextField("");
                    t6.setBounds(270, 230, 50, 24);
                    frame3.add(t6);
                    ActionListener action = new MyActionListener(frame3,t5,t6);
                    Button b1  = new Button("Button1");
                    b1.setBounds(170, 400, 120, 24);
                    b1.addActionListener(action);
                    frame3.add(b1);
                    Button b2  = new Button("Button2");
                    b2.setBounds(300, 400, 120, 24);
                    b2.addActionListener(action);
                    frame3.add(b2);
                    frame3.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                            frame3.dispose();
                    frame3.setVisible(true);
                else {
                    mw.exit();
          class MyActionListener implements ActionListener {
                private Frame frame3;
                private TextField t5;
                private TextField t6;
                public MyActionListener(Frame frame3,TextField tf5,TextField tf6)
                    this.frame3 = frame3;
                    this.t5 = tf5;
                    this.t6 = tf6;
                public void actionPerformed(ActionEvent e) {
                    String s = e.getActionCommand();
                    if (s.equals("Button1")) {
             // I think code for the Button1 action can be written here  
          else if (s.equals("Button2")) {
             // I think code for the Button2 action can be written here  
           

Maybe you are looking for

  • Error in making report

    I am trying to make a report for a database.  I have vb2010 express.  I have the option to add the crystal report viewer to a form, but when I try to make a report, it gives me the error "The system cannot find the file specified.(exception from HRES

  • Enhancement Point in ABAP code

    Hi , I am working on an upgrade from 4.6 to ECC ,so have a  have a standard FM with an enhancement point , how do i know if there is an implementaion for that or not and can i debugg the code in the enhancement point . When i click on the enhancement

  • Templates link to template folder

    hi. I not used to using dreamweaver. I would MUCH rather write html by hand. but my boss uses DreamWeaver and I am trying to update a template that he made. so he created a "site" in dreamweaver so it put all his files in its own structure and all. b

  • Game down load audio  no video

    I down loaded a Big Fish Game cd into my mac mini, the audio is there but the video is not.  Just have a black screen.

  • Aggregate Query Problem

    I have a partioned table containing 2002 data with the following format: TAGNAME NOT NULL VARCHAR2(15) DATA_TYPE NOT NULL CHAR(1) DATA_DATE NOT NULL DATE QUALITY CHAR(1) AVERAGE NUMBER(22,6) MINIMUM NUMBER(22,6) MINTIME DATE MAXIMUM NUMBER(22,6) MAXT