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

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();
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
    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();
    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) {
   = main;
        // respond to the Exit menu choice
        public void actionPerformed(ActionEvent e) {
            if (e.getSource() == this.itmPE) {
               final Frame frame1 = new Frame("Frame1");
                t1 = new TextField("");
                t1.setBounds(230, 230, 50, 24);
                t2 = new TextField("");
                t2.setBounds(330, 230, 50, 24);
                t3 = new TextField("");
                t3.setBounds(430, 230, 50, 24);
                t4 = new TextField("");
                t4.setBounds(530, 230, 50, 24);
                frame1.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
            if (e.getSource() == this.itmPRE) {
              final  Frame frame2 = new Frame("Frame2");
                t1 = new TextField("");
                t1.setBounds(230, 230, 50, 24);
                t2 = new TextField("");
                t2.setBounds(330, 230, 50, 24);
                t3 = new TextField("");
                t3.setBounds(430, 230, 50, 24);
                t4 = new TextField("");
                t4.setBounds(530, 230, 50, 24);
                frame2.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
           if (e.getSource() == this.itmRE) {
             final   Frame frame3 = new Frame("Frame3");
                t1 = new TextField("");
                t1.setBounds(230, 230, 50, 24);
                t2 = new TextField("");
                t2.setBounds(330, 230, 50, 24);
                t3 = new TextField("");
                t3.setBounds(430, 230, 50, 24);
                t4 = new TextField("");
                t4.setBounds(530, 230, 50, 24);
                frame3.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
            if (e.getSource() == this.itmTE) {
              final  Frame frame4 = new Frame("Frame4");
                t5 = new TextField("");
                t5.setBounds(170, 230, 50, 24);
                t6 = new TextField("");
                t6.setBounds(270, 230, 50, 24);
                t7 = new TextField("");
                t7.setBounds(370, 230, 50, 24);
                t8 = new TextField("");
                t8.setBounds(470, 230, 50, 24);
                ActionListener action = new MyActionListener(frame4, t5, t6, t7, t8);
                Button b1  = new Button("Button1");
                b1.setBounds(170, 400, 120, 24);
                Button b2  = new Button("Button2");
                b2.setBounds(300, 400, 120, 24);
                Button b3  = new Button("Button3");
                b3.setBounds(420, 400, 120, 24);
                Button b4  = new Button("Button4");
                b4.setBounds(550, 400, 120, 24);
                frame4.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
            else {
      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  

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.

  • 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.
    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

    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:
    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.

    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:
    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:
    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.

    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.

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

    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.

    You could use SQL*Plus' COPY command
    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

    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:
    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.
    Transfer SQL Server Objects Task
    Transfer SQL Server Objects Task in SSIS 2008 R2 With Example
    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...
    it_partner = lt_partner_com
    ct_input_fields = lt_input_fields
    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.

    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.
    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

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

  • 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
    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.

    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.

  • 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. gy-—-aperture-brushes-unmasked/
    Comments welcomed, of course.

    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)
    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 ???

    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

  • How to install My forms and reports in IAS?

    Hi Gurus, I installed database 10g,IAS10g,forms and reports10g separately. now i want to configure my forms and reports in IAS 10g.i can run the form from formbuilder after started the oc4j.but i am not able to run in ias . anybody know the link" how

  • How to use a extract?

    Hi , Can i use EXTRACT (FIELD GROUPS) in a ordinary select without any logical database? If yes, send me some sample for that. Thanks, Nithya.

  • WebAccess Maximum Message/Attachment Size?

    Is there a way to limit the size of messages (or attachments) with GroupWise WebAccess 8.0.2? I've set the size limit for the domain (Client Options --> Disk Space Mgmt --> Maximum Message Size) which is working great for my Win32 clients. It doesn't

  • Regarding fetching the data through dadabase

    HI ABAP GURU'S CAn anyone sole my problem. Here is one database table .Which have three fields ( Name , EmailId , DOB) . Email ID is primary key. We have one form for users, in which there are three fields .Name , EmailId, DOB( Date of Birth).When us

  • Evaluation path for B002 - OOAW

    Hi I'm creating a evaluation path for fetching all reports under a line manager. Can someone please throw light on how to configure thie in OOAW. It works fine SAP_MANG, I tried to modify but iam not able to get this. - Aravind