How to copy a value from one Frame to another Frame.

Hi,
I am new to Swing and AWT prgramming .
I have created a menu called " Test window " and it contains toplevel menu item "File" and File Menu contains subitems "Product Evaluation", "ProcessEvaluation", "ResourceEvalation", "TotalEvaluation" and "Exit".
When i click File->Product Evaluation it displays a new Frame named frame1 , similarly if i click ProcessEvaluation , ResourceEvalation , TotalEvalation it displays frame 2 , frame 3 and frame 4 Respectively,
frame 1 , frame 2, frame 3 contains four textfields with names t1,t2,t3 and t4.(NOTE: I have given same names for textfields in all three frames so that in future i want to extend my GUI).
frame 4 contains 4 textfields with names t5,t6,t7,t8 and 4 buttons (b1,b2,b3,b4).
After i compile my program i will select ProductEvaluation and enter some values in textfield of frame 1 and minimise it. Similary i will open ProcessEvaluation and TotalEvaluation and enter values in textfields of frame2 and frame3 and minimise them.
My queston is now if i select TotalEvaluation and press Button1 in frame 4 it should display in textfield t5 the value extracted from t1 in frame1 added to the value extracted from t1 in frame 2 added to the value extracted from t1 in frame 3.
ie after pressing Button 1 textfield t5 should conatin value of t1 in frame1+ value of t1 in frame2 + value of t1 in frame3.
I am sending the code.
Can you please help me.
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, t3, t4,t5,t6,t7,t8;
    // 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 itmRE   = new MenuItem("ResourceEvaluation");
        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.itmRE.addActionListener(this);
            this.itmTE.addActionListener(this);
            this.itmExit.addActionListener(this);
            this.add(this.itmPE);
            this.add(this.itmPRE);
            this.add(this.itmRE);
            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);
                t3 = new TextField("");
                t3.setBounds(430, 230, 50, 24);
                frame1.add(t3);
                t4 = new TextField("");
                t4.setBounds(530, 230, 50, 24);
                frame1.add(t4);
                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);
                t3 = new TextField("");
                t3.setBounds(430, 230, 50, 24);
                frame2.add(t3);
                t4 = new TextField("");
                t4.setBounds(530, 230, 50, 24);
                frame2.add(t4);
                frame2.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                        frame2.dispose();
                frame2.setVisible(true);
           else
           if (e.getSource() == this.itmRE) {
             final   Frame frame3 = new Frame("Frame3");
                frame3.setSize(700,700);
                frame3.setLayout(null);
                t1 = new TextField("");
                t1.setBounds(230, 230, 50, 24);
                frame3.add(t1);
                t2 = new TextField("");
                t2.setBounds(330, 230, 50, 24);
                frame3.add(t2);
                t3 = new TextField("");
                t3.setBounds(430, 230, 50, 24);
                frame3.add(t3);
                t4 = new TextField("");
                t4.setBounds(530, 230, 50, 24);
                frame3.add(t4);
                frame3.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                        frame3.dispose();
                frame3.setVisible(true);
            else
            if (e.getSource() == this.itmTE) {
              final  Frame frame4 = new Frame("Frame4");
                frame4.setSize(700,700);
                frame4.setLayout(null);
                t5 = new TextField("");
                t5.setBounds(170, 230, 50, 24);
                frame4.add(t5);
                t6 = new TextField("");
                t6.setBounds(270, 230, 50, 24);
                frame4.add(t6);
                t7 = new TextField("");
                t7.setBounds(370, 230, 50, 24);
                frame4.add(t7);
                t8 = new TextField("");
                t8.setBounds(470, 230, 50, 24);
                frame4.add(t8);
                ActionListener action = new MyActionListener(frame4, t5, t6, t7, t8);
                Button b1  = new Button("Button1");
                b1.setBounds(170, 400, 120, 24);
                b1.addActionListener(action);
                frame4.add(b1);
                Button b2  = new Button("Button2");
                b2.setBounds(300, 400, 120, 24);
                b2.addActionListener(action);
                frame4.add(b2);
                Button b3  = new Button("Button3");
                b3.setBounds(420, 400, 120, 24);
                b3.addActionListener(action);
                frame4.add(b3);
                Button b4  = new Button("Button4");
                b4.setBounds(550, 400, 120, 24);
                b4.addActionListener(action);
                frame4.add(b4);
                frame4.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                        frame4.dispose();
                frame4.setVisible(true);
            else {
                mw.exit();
      class MyActionListener implements ActionListener {
            private Frame frame4;
            private TextField t5;
            private TextField t6;
            private TextField t7;
            private TextField t8;
            public MyActionListener(Frame frame4,TextField tf5, TextField tf6, TextField tf7, TextField tf8)
                this.frame4 = frame4;
                this.t5 = tf5;
                this.t6 = tf6;
                this.t7 = tf7;
                this.t8 = tf8;
            public void actionPerformed(ActionEvent e) {
                String s = e.getActionCommand();
                if (s.equals("Button1")) {
         // I think code for the Button1 action can be written here  
    

hi,
u have ot submit the values using
b1 for f1,
b1 for f2 and
b1 forf3
after u can access the values in to f4 other wise u con't
what u have to do use method in each frame like
setValueforframe1() { } and 2 and 3
and u can call this method in frame 4 and u can get the values

Similar Messages

  • How to get a value from one item into another

    How can i get value from one item into another item.
    Ex: I have a report, in there i have check boxes, and when i have checked some rows, and press submitt, a prosses computates it into a item on another page, and a branche redirects to page 3. Then i'm going to use the value in the item into a PL/SQL script in an report to show the submittet items.
    How can i do this?
    Computation script, pages and all that is fixed. But i dont know which PL/SQL statement to use to get th value from the item.

    Hi Fredr1k,
    Use the V() function from pl/sql.
    e.g. V('P3_MY_ITEM')
    will return the value of that page item.
    As long as the pl/sql is called from within the Apex environment.
    Regards
    Michael

  • How to copy OVD configuration from one machine to another?

    We have two machines with OVD servers on them. The configurations should be identical from one machine to the other. We suspect there is a problem with the configuration on one of them. We need to know how to copy OVD configuration from one machine to another.
    Can you tell us how to do that?

    well i have this in mind which may help you.
    You would need to have a public ip address to the machine you have consoled to and on internet.
    Download the tftp software from below link.
    http://tftpd32.jounin.net/
    This software does not only act as the tftp server but also you can select the interface of you ethernet card as tftp server ip address.
    For ex if you are connected to a console and have a wireless card which is connected to internet also you connect you eth lan card to the eth or fast eth of the router.
    you can select which ever interface you want to act as the tftp server.
    you will need to add ip addres for you lan card and also config the router port as same if needed.

  • How to copy List item from one list to another using SPD workflow using HTTP call web service

    Hi,
    How to copy List item from one list to another using SPD workflow using HTTP call web service.
    Both the Lists are in different Web applications.
    Regards, Shreyas R S

    Hi Shreyas,
    From your post, it seems that you are using SharePoint 2013 workflow platform in SPD.
    If that is the case, we can use Call HTTP web service action to get the item data, but we cannot use Call HTTP web service to create a new item in the list in another web application with these data.
    As my test, we would get Unauthorized error when using Call HTTP web service action to create a new item in a list in another web application.
    So I recommend to achieve this goal programmatically.
    More references:
    https://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    https://msdn.microsoft.com/en-us/library/office/dn292552.aspx?f=255&MSPPError=-2147217396
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How To Copy Selected Music From One Library to Another?

    What is the best way to copy selected music from one library to another?
    I have a big and growing iTunes library -- 33,000 songs.
    A year ago I copied my library to my daughter's new iMac.  Now, a year later, I'm off to visit her and wonder how best to update her library.  In the past year I have added a number of items to my library and I'm sure she has done the same -- some might be the same but many will be different.
    How do I update her library with the new things I've added in the past year but not wipe out things she had added or duplicate when we each have a song?
    I can load any / all of my stuff on an external HD and take that to plug in to her computer.  Then what?  I want to avoid duplicates and make sure I get stuff like album artwork.
    I'm running iTune 10.4 on an iMac with OS X 10.6.8 -- my daughter will have the same iTunes and OS X once we update her software.
    Any advice would be great.
    Thanks

    If you're sharing the same Apple ID and all your songs are from the iTunes Store, it's easy:
    In iTunes on your computer, go to File->Preferences->Store and check the box next to MUSIC under AUTOMATIC DOWNLOADS.
    You should also read this article, the section titled TO DOWNLOAD PREVIOUSLY PURCHASED APPS, BOOKS, MUSIC, OR TV SHOWS TO YOUR COMPUTER:
    http://support.apple.com/kb/ht2519
    You could also use an rsync utility such as backuplist+ to perform a 2-way sync of the files in your two libraries while your computers are connected via FireWire with one of them in FireWire Target Disk Mode, or from your external hard drive with your daughter's computer and then to yours again. After that, you'll need to use iTunes on each computer to update its library with the new files:
    http://rdutoit.home.comcast.net/~rdutoit/pub/robsoft/pages/backup.html
    This last would also be the preferred method if you have authorized each other's computers for media purchased with each other's Apple IDs (i.e. you are not sharing the same Apple ID), or if you have music from sources other than the iTunes Store. Most likely, though, music from sources other than the iTunes Store would not be legal to copy in this way for this purpose, although there is probably no technical impediment.

  • How to copy pf-status from one program to another program

    Hi Gurus,
    Can any one tell me the procedure how to  copy pf-status of one program to another program .if i want to copy pf-status which is in production server to development server how can i do this.pls help me out.
    Regards.

    Hi,
    GO TO  SE41,
    Select Status,
    In from u can give  ur old pgm and staus name
    In To u can ur new one .
    Save and activate.
    Regards,
    S.nehru.

  • How to copy form data from one pdf to another?

    Hi,
    I have created a pdf, added form data to it. Saved the form data as a fdf file - all good.
    I've updated the document and saved as a new pdf and would like to load the fdf data into it.
    So I select tools - forms - more forms options, and press the "import" function  - it goes grey and nothing happens.
    If I re-open the document the import function remains greyed out.
    I can find no way to import this data.... any ideas?
    I've tried going into form edit mode - adding a new field.  The import option is no longer greyed out so I click it and can select the fdf file hit open and ... the dialogue disappears and nothing happens.
    Is my Acrobat XI 11.0.07 badly installed - or what?

    You need to learn about the different types of PDFs. PDF/ A is an archive format that does not allow changes. PDF/X is used for graphics exchange
    For forms I would use only the PDF with a target version. Do not use the Optimizer feature.
    Forms always become larger due to the need to include the font for the various form fields. You might have to review the type fonts used by the form fields and one standard font as much a possible.
    It is possible to use the FDF file to move field values from one PDF to another.
    If you are trying to replace the underlying content and keep the form fields, use the replace pages.

  • How to copy the data from one database to another database without DB link

    Good Day,
    I want to copy the data from one database to another database with out DB link but the structure is same in both.
    Thanks
    Nihar

    You could use SQL*Plus' COPY command
    http://technology.amis.nl/blog/432/little-gold-nugget-sqlplus-copy-command
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/apb.htm#sthref3702
    Edited by: Alex Nuijten on Sep 16, 2009 8:13 AM

  • How to Copy the PLD from one database to another

    Dear Members,
       i have designed the  PLD for Purchase Order, i want to copy the particular PLD into another Database.
    i tried to copy the PLD from one database to another through copy express.. i copied the PLD sucessfully. But the problem is,it copies all PLD's from one database to another. i want only the Purchaseorder PLD has to be copied in to another database.any body can help me in this regard.
    With Regards,
    G.shankar Ganesh

    Hi,
    select * into A1 from RDOC where Author !='System'
    select *  into A2  from  RITM   where Doccode  in (select Doccode from A1 )
    select * from A1
    select * from A2
    sp_generate_inserts 'A1'
    sp_generate_inserts 'A2'
    you will get Insert scripts of A1 and A2 tables .After that You 'll  Replace A1 to RDOC and A2 to RITM.
    So that you can RUN this SQL srcipts any where (In any Database)
    but First u have to run sp_generate_inserts  Storeprocedure(from websites) .
    drop table A1,A2

  • Simple: How to copy a Table from one Database to another?

    I already know how to do it by creating an identical table and then inserting the Data.
    Like so:
    SET IDENTITY_INSERT dByDtMinusC5 ON
    INSERT INTO [DB1]..T1 ([Id], [HbyD] , [K] )
    SELECT [Id], [[HbyD]]] ,[K] FROM [DB2]..T2
    As you can see I need to have T1 in order to copy T2 into DB1. Is there any way that I could auto create T1 and copy T2?
    There are so many forums in sql server Category, I hope I posted in the right one :0 . We need tag system for forums.   

    Hi Bhupinder,
    According to your description, you want to copy a table with Primary keys from one database to another database.
    As per my understanding, I think the best method is use Transfer SQL Server Objects Task in SQL Server Integration Services. The Transfer SQL Server Objects task transfers one or more types of objects in a SQL Server database between instances of SQL Server.
    Server roles, roles, and users from the specified database can be copied, as well as the permissions for the transferred objects. Indexes, Triggers, Full-text indexes, Primary keys, Foreign keys can also be copied.
    To use the Transfer SQL Server Objects Task, we should create a SQL Server Integration Services Project in SQL Server Data Tools, then drag a Transfer SQL Server Objects Task to Control Flow pane. Specify SourceConnection, SourceDatabase, DestinationConnection
    and DestinationDatabase for the Connection, select the table in the ObjectsToCopy category, then change CopyPrimaryKeys to True and the other corresponding properties in the task.
    References:
    Transfer SQL Server Objects Task
    Transfer SQL Server Objects Task in SSIS 2008 R2 With Example
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to Copy Customized Partner From One Opprtunity to Another in CRM

    Hi experts,
    How to save more than one same type partner(with same partner FCT) in CRM opportunity Application?
    I am using following Function Module...
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
    it_partner = lt_partner_com
    CHANGING
    ct_input_fields = lt_input_fields
    EXCEPTIONS
    error_occurred = 1
    document_locked = 2
    no_change_allowed = 3
    no_authority = 4
    OTHERS = 5.
    I am giving the input field name as 'PARTNER_FCT', 'PARTNER_NO', 'DISPLAY_TYPE', 'NO_TYPE', 'MAIN_PARTNER' and 'RELATION_PARTNER'.
    I have created one partner function for saving additional entity. And I am trying copy one existion opportunity by using CRM_COPY_PROCESS. And I am maintaining that partner via 'CRM_ORDER_MAINTAIN'. But it is not saving the data in session level also.
    The limit of that partner FCT record is 0-999.
    Please help me how to save this.

    Hi,
    Forgive me if I've misunderstood your query, but what you are asking sounds like standard customization to me - Copy Control.  I assume you have created your own Opportunity type and that is where the problem lies?
    Have a look at the following IMG path (transaction SPRO > then press F5 on next screen to open the IMG):
    SAP Implementation Guide > Customer Relationship Management > Transactions > Settings for Opportunities > Define Copying Control for Opportunity Item to Opportunity
    Create an entry for your opportunity by entering the source opportunity (to copy the partner from) and the target opportunity (to copy the partner to) and tick the "Partners" checkbox for the new entry - that will automatically copy the partner from one opportunity to the next as specified.
    Hope this helps.
    Thanks,
    Andrew G.

  • How to copy a query from one infoprovider to another infoprovider

    Hi Experts,
    Could anyone suggest me on how to copy a particular query from one infoprovider to another infoprovider which are identical and have the same objects in them.
    Thanx in advance
    Lalit

    Hi Lalith,
    Use the Transaction RSZC and specify the - > Source InfoCube  -> Target InfoCube and select the queries  you want to copy.
    Hope it helps
    Regards
    Srikanth

  • HOW to copy Form field from one RTF to another RTF

    Hi Expert
    I have developed 20 reports in BI Publisher which is using xml as data source. So to access the data i have done the xml coding for each form field.
    Now i want to copy the form field from one rtf to another, while doing the copy paste of the form field from one rtf to another it is not copying the xml coding. It is appearing in the new rtf as below
    <?ref:xdo0391?>
    Can you guys suggest me how to achieve the same. Is there any setting need to be changed so that while do the copy paste the form field it will copy the backend code also.
    Thanks in advance.
    Thanks
    Srikant

    make your template set as backward compatabile before you do anything on template. load the xml and then copy the form field. it should work. dont try to open the field without loading xml.

  • How to copy iPhoto keywords from one library to another

    I have over 30 iPhoto Libraries.  Managing them is great using iPhoto Library, but keyword management is awful (if iPLM has a way I haven't found it).  I would like to know how to copy keywords from one library to another.  It's a pain to have to continually doing manual setup.
    In advance, THANKS!

    With that many photos you might consider using one of the high end DAM (digital asset management) applications.  I use Media Pro 1. It uses catalogs of thumbnails that are linked to the photos on your hard drive, CDs or wherever.  A single catalog can hold 250,000 images.  It uses Catalog Sets like Events in iPhoto.  There are Categories which are like albums in iPhoto.  Those and Catalog Sets are virtual.  You can batch rename files once in the catalog either by date or text.  The folders holding the photos on the hard drive can be set up auto update in the catalog so when you add a photo to the folder it will appear in the catalog. You can add keywords, hierarchical keywords, descriptions, etc. and write them back to the original file. 
    It has some built in editing capability and versioning capability. Clicking on a keyword will display all photos with that keyword quickly.  Searches can be made across multiple catalogs and have the results displayed in a new catalog.
    I use it as my primary DAM and iPhoto for special projects like books, etc. The catalogs can be viewed and keywords, descriptions added, etc. without the original files being available.  You just can't do any editing, slideshows or anything that requires the full sized file.
    OT

  • How to copy brush masks from one adjustment to another

    Thought the readers of this forum might like to read my recent blog post on the aforementioned subject, with complete step-by-step instructions.  I've been successfully using the technique outlined in the post for quite some time and finally got around to writing up a little tutorial.
    http://johnpurlia.wordpress.com/2011/06/06/and-now-a-short-venture-into-technolo gy-—-aperture-brushes-unmasked/
    Comments welcomed, of course.
    Enjoy!!

    Hi Tina,
    To copy either a Script or a Smartform fron one client to another client i.e from reference client 000 to any client say 010  follow instructions as given below:
    Go to Tcode SE71->Give Form name MEDRUCK then go to Menu path Utilities->Copy From Client, give
    Form Name: MEDRUCK
    SOURCE:000 (it will be already there)
    Target Form: Zmedruck(here give ur form zname)
    Execute
    It will be copied into all languages.
    Then come back to SE71
    Give your form name Zmedruck
    Language:: de then goto change mode
    then menu path->utilities->convert original languge to En and enter you will get a message original language of form zmedruck converted from de to en,
    now  change language de to en in se71 main screen and then do what ever changes you want to do , this is how you can copy a script or smartform from one client to another client.
    If this answer is useful reward points any queries revert me back.

  • How to copy a file from one location to another ???

    Hi,
    I have a file ('D:/Pictures/1.jpg') and I want to copy this 1.jpg file to a location called 'D:/Folder1'. I tried the WebUtil_File.copy_file function, but it does not work. it returns false boolean.
    I am using windows xp and oracle 10g.
    The webutil configurations are also completed.
    This D: drive is the one which has oracle 10g application server installed.
    Am I doing anything wrong or missed?. I need to complete this urgently. but it does not work.
    Or any other way to copy a file from one place to given any path?. After this I have to renaming (may be using Rename_File function) the copied file. Please advice me.

    An alternative could be HOST command, that calls OS prompt to run a command in the server and then return the focus to the Forms:
    HOST ('copy D:/Pictures/1.jpg D:/Folder1/1.jpg');
    Edited by: Kleber M on Sep 9, 2011 12:38 PM

Maybe you are looking for

  • Using Pro*C on Linux Oracle 8.1.6.0 on RH 6.2

    Whe have some problems using Pro*C: the program runs ok on all Oracle versions, including Oracle 8.1.6.0 on DEC OSF, but various sql errors are encountered on Linux Red Hat 6.2: 1) "ORA-01458: invalid length inside variable character string" for this

  • Strange display problems: lines, missing icons, pieces of windows that stay on screen...

    My white 24" iMac has recently started having problems with the display. Because I'm able to capture it with Grab and due to the nature of the problem, it doens't appear to be hardware related. But, not sure. See the screen cap I took below as an exa

  • MiniSAP CDs

    Hello, I purchased a used ABAP Objects book and unfortunately, it did not have the second CD so I could not complete the installation of miniSAP.  Does any one knows where can I get a copy of the second cd? Thanks

  • Setting the background of a vi running in a subpanel to transparent

    Does anyone know of a way to set the background of a vi running in a subpanel (or just running at all for that matter)  to transparent while maintaining 100% opacity for all other items on the front panel? Thanks, Nate

  • Server Supports sorting control but get unavailableCriticalExtension

    I am getting unavailableCriticalExtension when sending server control type "1.2.840.113556.1.4.473" (sortKeyList) criticality: True SortKeyList: 1 item attributeType: sn I found the following description that sort of makes sense but how do I fix this


HashFlare