How can I pass variable's from one frame to other

//This is the first frame where the value in the TextField
//tf1 and tf2 are to be passed to 2nd Frame
import java.awt.*;
import java.awt.event.*;
public class del extends Frame implements ItemListener,ActionListener
public Panel p,p1,p2;
public Button b,n;
public Label l1,l2;
public TextField tf1,tf2;
public del()
setLayout(new FlowLayout(FlowLayout.LEFT));
Panel p=new Panel();
n=new Button("Submit");
p.add(n);
add(p);
l1=new Label(" Enter the Temperature : ");
tf1=new TextField(5);
p.add(l1);
p.add(tf1);
add("South",p);
l2=new Label(" Enter the Compund ");
tf2=new TextField("N-OCTANE",15);
p1=new Panel();
p1.add(l2);
p1.add(tf2);
add("South",p1);
setSize(600,700);
setVisible(true);
public void itemStateChanged(ItemEvent ie)
repaint();
public void actionPerformed(ActionEvent a)
if(a.getSource()==n)
this.setVisible(false);
new Finalput1();
repaint();
public static void main(String[]args)
del d=new del();
//2nd Frame which will appear on clicking submit button
import java.awt.*;
class del1 extends Frame
public static double T;//value in 1st text field has to be stored in variable T
String compd=" ";//value in 2nd textField has to be stored in this string
TextField tf;
public del1()
setLayout(new FlowLayout());
setSize(800,700);
setVisible(true);
public void paint(Graphics g)
g.drawString(" INPUT DATA : - ",30,120);
g.setColor(Color.black);
g.drawString(" Component Name ="+compd,20,160);
g.drawString(" Temperature of the Mixture ="+T,30,250);
public static void main(String[]args)
new del1();
Pls help me.
I will be happy if anyone help's me!

Both your classes seem to be independent applications. (they are public, and they have their public static void main)
Is this your intention? If so, your question is how to pass data from one application to another. That can be done in many ways, and it is a complicated issue. (if one application wants to pass data to another, you first have to find the other one, and if it isnt running you might want to start... - lots of things to think about.)
If what you want to do is simply to pass data from one Frame to another, the matter is quite more simple.
Here is a sample:
import java.awt.event.*;
import java.awt.*;
public class F1 extends Frame implements ActionListener
private F2 theOtherFrame;
public F1()
Button b;
b=new Button("Action");
b.addActionListener(this);
add(b);
setSize(100,100);
setVisible(true);
public void actionPerformed(ActionEvent e)
if (theOtherFrame == null)
     theOtherFrame = new F2();
     theOtherFrame.setSize(100, 100);
theOtherFrame.setSomeData("Her you have som data");
theOtherFrame.setVisible(true);
public static void main(String[] args)
new F1();
class F2 extends Frame
private String strData;
private Label lab;
public void setSomeData(String str)
lab.setText(str);
repaint();
public F2()
lab = new Label();
add(lab);

Similar Messages

  • How can I pass the photos from one iphone to another?

    how can I pass the photos from one iphone to another?

    Use the Beaming feature. See the info at the ? In iPhoto for iOS.

  • How can I pass an exception from one thread to another thread

    If I create a new class, that will extends the class Thread, the methode run() can not be use with the statement Throws Exeption .
    The question now: Is there any possibility to pass an exception from one thread to another thread?
    Thx.

    It really depends on what you want to do with your exception. Is there some sort of global handler that will process the exceptions in some meaningful way? Unless you have that, there's not much point in throwing an exception in a thread, unless you simply want the stack trace generated.
    Presuming that you have a global handler that can catch exceptions, nest your Exception subclass inside a RuntimeException:
    public class NestedRuntimeException extends RuntimeException
        private final m_nestedException;
        public NestedRuntimeException(final Exception originalException)
            super("An exception occurred with message: " + originalException.getMessage());
            m_nestedException;
        public Exception getNestedException()
            return m_nestedException;
    }Your global handler can catch the NestedRuntimeException or be supplied it to process by the thread group.

  • How can I pass a value from one application to another through URL

    I am passing a value APP_USER from one application to another application (item is P_ASK_U) through navigation bar entrees URL.
    This is working with in the application..(javascript:popupURL('f?p=&APP_ID.:165:&SESSION.::&DEBUG.::P_ASK_U:#&APP_USER.#') )
    This one is not passing the value, eventhough it open the application..
    javascript:popupURL('http://htmldb.oracle.com/pls/otn/f?p=35129:1:::P_ASK_U:&APP_USER.');
    Is there any syntax error or is it not possible, please let me know..
    Thanks
    Venu

    Hi Scott,
    You are right, the first one do not need # character.
    In the Doc it is mentioned as....
    Pass the value on a URL reference using f?p syntax. For example:
    f?p=100:101:10636547268728380919::NO::MY_ITEM:ABC
    I am using the following URL, it pops up the external application, but it is not passing the APP_USER value to the page item of that application.
    javascript:popupURL('http://htmldb.oracle.com/pls/otn/f?p=35129:1::P_ASK_U:&APP_USER.');
    sorry I still do not know what I am missing..
    Thanks
    Venu

  • How can i add selected element from one node to other node

    Hi All
    I have below requirement.
    Say In the view leftside Available Languages ItemList Box  Rightside Available Languages ItemList Box and Add & Remove Buttons in the middle.
    User selects languages from Available Languages ItemList Box clicks on add it will adds to the Available Languages Item List box and ViceVersa with Remove Button.
    1) I have created 2 nodes 1) AvlLang 2) SelLang both contains two attributes Key and Value.
    2) For AvlLang node,  Property : Data Dictonary binded with table. Values are coming fine in Available Languages ItemList Box.
    3) How can i add selected language into the node Available Languages.
    Please provide the code snippet how to achieve this.
    BR
    X- CW

    Hi Carlin,
    Find below code to copy selected record from one node to another.
    Here I am copying it_lips node into pack_mat node.
    DATA: wa_temp TYPE REF TO if_wd_context_element,
                lt_temp TYPE wdr_context_element_set,
                count type c.
          DATA : lo_nd_it_lips TYPE REF TO if_wd_context_node,
                 lo_el_it_lips TYPE REF TO if_wd_context_element,
                 ls_it_lips TYPE wd_this->Element_it_lips,
                 lt_it_lips TYPE wd_this->Elements_it_lips,
                 ls_unpack TYPE wd_this->Element_unpack,
                 lt_unpack TYPE wd_this->Elements_unpack.
    * navigate from <CONTEXT> to <IT_LIPS> via lead selection
          lo_nd_it_lips = wd_context->path_get_node( path = `ZRETURN_DEL_CHANGE.CHANGING_3.IT_LIPS` ).
          CALL METHOD lo_nd_it_lips->get_selected_elements
            RECEIVING
              set = lt_temp.
    * navigate from <CONTEXT> to <PACK_MAT> via lead selection
          lo_nd_pack_mat = wd_context->get_child_node( name = wd_this->wdctx_pack_mat ).
          LOOP AT lt_temp INTO wa_temp.
            CALL METHOD wa_temp->get_static_attributes
              IMPORTING
                static_attributes = ls_it_lips.
                  ls_pack_mat-vgbel = ls_it_lips-vgbel.
                  ls_pack_mat-vgpos = ls_it_lips-vgpos.
                  append ls_pack_mat to lt_pack_mat.
                  CLEAR ls_pack_mat.
          endloop.
            lo_nd_pack_mat->bind_table( new_items = LT_PACK_MAT
                                        SET_INITIAL_ELEMENTS = abap_true ).
    Cheers,
    Kris.

  • HT204053 How can I transfer my apps from one account to another

    How can I transfer my apps from one account to another

    Apple will not permit transfer of applications from one account to another. Suppose your mom has presented an iPad to you and before presenting she has downloaded some Apps with her account. If you want to update those Apps, you must know her pass word or send the iPad to her and request her to update and give back. If you feel it is time consuming and difficult, the best way is purchase new iPad and down load  the latest version of App. Whenever you come across you go on purchasing new iPad. This will help you to have latest version of iPad with you.
      Ramanujam, Hyderabad.

  • How can I move purchased apps from one itunes account to another account?

    How can I move purchased apps from one itunes account to another account?

    You can't. The apps must be purchased separately.

  • I have no problems copying iMovie Events from one Mac to another, however, how can I copy iMovie Projects from one Mac to another?

    I have no problems copying iMovie Events from one Mac to another, however, how can I copy iMovie Projects from one Mac to another?  Any help will be appreciated.  Thank you.

    This should give you some good insight, I'd probably store them on an External HD on the old machine and then just drag and drop to the new machine.
    https://discussions.apple.com/docs/DOC-4141

  • HT4059 How can I move a book from one device to another

    How can I move an iBook from one device to another

    Now when I drag and drop the photo no red # shows up and the photo stays in project 1 and also shows up in project 2 apparently creating a duplicate.
    The projects are the basic containers.  Each image and all its versions are in exactly one project.
    You can use an image in many albums, without duplicating it, also in many products like books, screensaver, slideshows.  But the projects are the basic structure of the library and you cannot have the same image in two different project, without duplicating it by storing the same original image files twice. Use albums to organize your library thematically.
    Sorry, I misread your question.   Dragging an image file between projects should move the image and all its versions to the other project.  Aperture should only duplicate the image, if you hold down the alt/options key while dragging and move the image otherwise.
    Which Aperture version are you using? And which MacOS X version?  Is your profile signature "MacBook Pro with Retina display, Mac OS 9.2.x, Aperture 3.5.1" still valid?
    In Aperture 3.6 on MacOS X 10.10.1 dragging between projects is still working as expected:

  • How can I script moving paths from one file to another?

    Hello. I have 1 image with various color correction layers. The other is the exact same size but only contains paths. How can I script moving paths from one file to another? Thanks, in advance, for any help you can offer. Thanks!

    Thanks! This one actually worked for me. Thanks for your help.
    http://forums.adobe.com/message/3305389#3305389

  • How can I copy cell formatting from one range to another?

    How can I copy cell formatting from one range to another, including text fonts, colours, borders, etc., so that, for example, I can reuse a formatted reconciliation table again in different parts of a sheet?

    Hi George,
    Wayne found the Spinning Beachball of Death, and you will find it too.
    Numbers is not good at handling large datasets. Might I suggest that you group your data into smaller sets (each month, perhaps?) and save each group in a separate Numbers document. Numbers will not link between documents, but you could have a summary Table within each document. Then comes the "clunky" bit of copying all those summary tables into a master document where you do the final processing of the data.
    Regards,
    Ian.

  • How can you move the objects from one server to another?

    how can you move the objects from one server to another?

    Hi,
    Collecting objects for Transporting
    1. rsa1->transport connection
    2. left panel choose 'object type', middle panel choose 'infocube' and 'select objects'
    3. then choose your infocube and 'transfer'
    4. will go to right panel, choose collection mode 'manual' and grouping only 'necessary objects'
    5. after objects collection finished, create request
    6. If they are $TMP, then change the package.
    7. When you click the Save on the change package, it will prompt for transport. Here you can provide an existing open transport request number, or if you like here itself you can create a new one.
    8. You can check the request in SE09 to confirm.
    Releasing Transport Request  
    Lets say you are transporting from BWD to BWQ
    Step 1: In BWD go to TCode SE10
    Step 2: Find the request and release it (Truck Icon or option can be found by right click on request #)
    Note: First release the child request and then the parent request
    Steps below are to import transport (generally done by basis )
    Step 1: In BWQ go to Tcode STMS
    Step 2: Click on Import queue button
    Step 3: Double Click on the line which says BWQ (or the system into which transport has to be imported)
    Step 4: Click on refresh button
    Step 5: High light the trasnport request and import it (using the truck icon)
    Transport
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b5/1d733b73a8f706e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/0b/5ee7377a98c17fe10000009b38f842/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/224381ad-0701-0010-dcb5-d74236082bff
    Hope this helps.
    thanks,
    JituK

  • How can I move a photo from one project to another

    How can I move a photo from one project to another without creating a duplicate so I have the same photo in two projects.
    I seems to me in the past when I moved the photo from project 1 to project 2, I would get a number showing the # of photos being moved and you could drag and drop in the 2nd folder and the photos would disappear from project 1 and show up in project 2. is there a setting I am missing.  Now when I drag and drop the photo no red # shows up and the photo stays in project 1 and also shows up in project 2 apparently creating a duplicate.
    Any suggestion?

    Now when I drag and drop the photo no red # shows up and the photo stays in project 1 and also shows up in project 2 apparently creating a duplicate.
    The projects are the basic containers.  Each image and all its versions are in exactly one project.
    You can use an image in many albums, without duplicating it, also in many products like books, screensaver, slideshows.  But the projects are the basic structure of the library and you cannot have the same image in two different project, without duplicating it by storing the same original image files twice. Use albums to organize your library thematically.
    Sorry, I misread your question.   Dragging an image file between projects should move the image and all its versions to the other project.  Aperture should only duplicate the image, if you hold down the alt/options key while dragging and move the image otherwise.
    Which Aperture version are you using? And which MacOS X version?  Is your profile signature "MacBook Pro with Retina display, Mac OS 9.2.x, Aperture 3.5.1" still valid?
    In Aperture 3.6 on MacOS X 10.10.1 dragging between projects is still working as expected:

  • How can I move a clip from one movie to another

    How can I move a clip from one movie to another?

    If it's just a clip, you can simply go to the other project and Add Media/From Files and Folders.
    But if it's a part of your movie -- say a sequence of clips or a clip that's had effects added to it -- you technically can't cut and paste betweeen projects in Premiere Elements. However, some people have been able to do it using the third party program ClipMate, available online.

  • HT5538 how can I transfer several apps from one Apple ID to another?

    How can I transfer several apps from one Apple ID to another?

    Apps purchased by an Apple ID are forever associated with that ID.    Purchases can't be transfers to another Apple ID.

Maybe you are looking for

  • HT4436 Want to change apple ID and password

    How can u change my email and password. I did not use an email ending in apple, iCloud, or me.

  • How do I rearrange the order of songs on an album?

    I like to have the songs in the correct order because a lot of the time the artist intended for them to be listened to in a specific order. How do i rearrange songs in an album that are mixed up?

  • JNI error

    Hi for everyone... I'm having a problem with JNI, I have a C program, and i used Java and JNI to create an interface for it... I've done all like the Tutorial, created the shared library, created my interface... i've created a little class, just to t

  • Xcelsius for Reporting Services URL

    Hi, I am trying to use sql server reporting services in my Xcelsius project. Configured Xcelsius Gateway Service on the SQL server. Created Data source and report. After this, I was trying to connect to the gateway from xcelsius designer. For this i

  • User SIMPCDIA has no RFC authorization for function group BBPC

    Hello all, I am working with SRM 7.0 and when I try to list all account values in the corresponding matchcode, I have this error message: User SIMPCDIA has no RFC authorization for function group BBPC User SIMPCDIA is a dialog user created in backend