Sending text from one JFrame to another

I've been trying to create a program which creates two JFrame objects obtained as instances of the classes InFrame and OutFrame, each of them containing a textfield and a textarea. I want to accomplish the following:
1) on the textField in JFrame1 I type text. I hit ENTER and because it has an actionListener it comes out on the textarea on the JFrame2
2) on the textField in JFrame2 I type text. I hit ENTER and it comes out on the textarea on the JFrame1, some sort of Chat Simulator.
I already made the first textField to receive input and display it on the textarea of JFrame2, but i haven't been able to do it for the other JFrame. Can anyone tell me how to finish it? Any help would be greatly appreciated.

I've been trying to create a program which creates two
JFrame objects obtained as instances of the classes
InFrame and OutFrame, each of them containing a
textfield and a textarea. I want to accomplish the
following:
1) on the textField in JFrame1 I type text. I hit
ENTER and because it has an actionListener it comes
out on the textarea on the JFrame2
2) on the textField in JFrame2 I type text. I hit
ENTER and it comes out on the textarea on the JFrame1,
some sort of Chat Simulator.
I already made the first textField to receive input
and display it on the textarea of JFrame2, but i
haven't been able to do it for the other JFrame. Can
anyone tell me how to finish it? Any help would be
greatly appreciated.Are these running in the same JVM? If so, then you should have a single "parent" (bad word choice) that handles instantiation of the 2 JFrames. It should also have a reference to each of them.
Have each of the JFrames present 3 methods:
1. public void addTextListener(ActionListener l):
This allows you to add an ActionListener to the TextField of one of the frames, which you can then have call the following methods.
2. public void appendText(String s):
Adds text to the TextArea
3. public String getText():
Gets the text in the TextField.
I can't help but think, tho, that both classes should be of the same type if they genuinely do the same thing.

Similar Messages

  • How can I send stuff from one iPhone to another via Bluetooth?

    How can I send stuff from one iPhone to another via Bluetooth?

    There are some apps that will let you send photos from one iOS device to another over BT.

  • How can I copy text from one card to another while creating cards using Iphoto?

    I created two cards with different pictures using Iphoto on Macnotebook. 
    I want to use the same text message.
    How can I copy text from one card to another?

    select the text and copy (edit menu ==> copy) tehn gpo to the next card and paste
    LN

  • How do I copy text from one layer to  another?

    I have Googled this but not a single answer seems to work.
    I am using Photoshop CS4 on OS X 10.6.7.
    OK, so  I  have a layer that  has some text in it.  I would like to  be able to  simply copy that  text  from one layer  to  another, but this seems to  be impossible as the Edit Paste menu item is grayed out after I have copied it in to the clipboard.  I can paste it into  the SAME layer, but not into another layer.
    This is how I am trying to  do  this.
    In the layer  with the text, click on the "T" icon to  the left.
    Click on the text, in the layer that I  want to  copy. 
    I select the text (either  by  clicking and dragging or pressing Command-A).
    Next I press Command-C.
    Then I  click on the layer In the Layer Panel) where I want to  paste the text.
    Pressing Command-V is impossible because the Edit-Paste menu option is grayed out!!!!
    WHY??????
    Perhaps more importantly, HOW do I copy text  from one layer to  another?

    First thing you can simply right click on the Text Layer and choose Duplicate Layer.  But that will create a new Text Lay
    er identical to the one you have.
    To answer your question in your case....  Create the Text Layer.   Make a New Layer.  Or have the layer you want to paste into visible.
    Highlight the text layer in the Layer Palette and Ctrl+Click (Win) Cmd+Click(Mac) so that you see marching ants walking around your text.
    Edit>Copy.
    Then highlight your Layer you want to paste into and hit Edit>Paste or Cmd+V / Ctrl+V.

  • Can you send iMessages from one iPad to another? If so how can I do this? Thanks

    I have just got a new iPad and I'm wondering if you can send iMessages from one iPad to another? We are currently trying this out and can only send iMessages from an iPad to an iPhone is this correct? Thanks

    You can use the Messages app to send messages to any iOS device or to a Mac running Mountain Lion. So yes you can send a message to another iPad.
    Both iPads have to have Messages set up and you need to contact the other iPad using an email addresses as the "you can be reached at" email address.
    Do you have it set up correctly on both iPads?
    http://osxdaily.com/2011/10/18/set-up-imessage-on-iphone-ipad-ipod-touch-with-io s-5/

  • Move text from one artboard to another

    Hi I have 3 artboards open and am trying to move text from one artboard to another, each piece of text is on a different layer, but when I use the selection tool and just drag it across to the next artboard, nothing shows up.  How do I move text from one artboard to another?  Thanks

    Dont worry I now have it sussed.  I just needed to move the layers up in the stacking order.

  • Can I Copy and Paste text from one Contact to Another on iPhone 3G?

    Can I Copy and Paste text from one Contact to Another on iPhone 3G?
    Or even better while the iPhone is connected to my PC can I view the address book on the iPhone and make changes using my PC keyboard?
    I had a challenge importing from my outlook as it created dual entries for people I had with multiple email addresses or telephone numbers so I need to copy and paste contact info from one to antoher.
    Can anyone help?

    MCWEB wrote:
    Can I Copy and Paste text from one Contact to Another on iPhone 3G?
    You will be able to do copy & paste when 3.0 comes out this summer.
    Or even better while the iPhone is connected to my PC can I view the address book on the iPhone and make changes using my PC keyboard?
    No. You would make changes to the address book on your PC and then sync via iTunes.

  • Can Pages copy text from one page to another automatically?

    Can Pages automatically copy text from one page to another?
    For example recurring text in a document e.g. addressee details or a date (not today's date).
    I want to type the topic title of one letter and have it automatically filled into the correct field in the next page which will be a letter to a different recipient.
    The letter text will be different for each recipient so mail merge probably won't work.
    Thanks
    Andy

    Thanks that worked great!!!(for the first line)
    Now why wont it populate more than the one other text field?
    F.Lic.Table1.Row1.agt_ssn_lic.rawValue = xfa.event.newText;
    F.PAGE3.agt_ssn_1.rawValue = xfa.event.newText;
    F.PAGE4.agt_ssn_2.rawValue = xfa.event.newText;

  • Send notification from one MBean to another

    How do you send notifications from one MBean to another, with both extending NotificationBroadcasterSupport?
    I don't mean using the POJO classes themselves, but sending a notification to the managed resource (from the ObjectName) of the other. I figured you'd perhaps add it to the Notification subclass you send, but I don't know how in the NotificationListener you'd send it to another ObjectName.
    What I'm trying to do is see perform an operation in one MBean in JConsole and see a message added to another MBean's notifications list. How might I be able to do this?
    Thanks.

    Hi,
    If you want MBean A to receive notifications from MBean B, then you only need MBean A to register as a notification listener with MBean B,
    Where's the problem?
    -- daniel

  • I have never used PS, and I am trying to edit a brochure created by someone else.  I need to move text from one column to another

    I have never used PhotoShop and do not have time at the present. Please help me to move a section of text from one column to another in a brochure.

    Here are 3 options for future reference:
    1. With the setup you've described, apply a Match Move behavior to  the text and make the rectangle the source. Change the Transform parameter to Mimic source.  This way you can still adjust the text postion as needed, but the rectangle will drive the animation.
    2. Use a group to do the animation.  Put both your rectangle and text in the same group and animate the group's postion.
    3. Use the Link behavior.
    Each of these has it's advantages depending on what you need.

  • Copy Text from one quote to another

    Hi
    I need to copy text/notes related to one quotation to another.. I tried FM SAVE_TEXT and CRM_TEXT_MAINTAIN_OW but neither of it worked...
    Can anyone help me with this ?

    Hi Ashwineee,
    U can copy text from one quote to another by customizing also
    Just Check the settings of your text type in the text determination procedure.
    Select ur  text type and click on details u will find the text id description sequence and
    Transfer  field u have various options  u select the option "B" for ur text type .
    U can take reference of the  Standard Text determination Procedure "ORDER001"  for doing the same
    for your text determination Procedure
    Menu Path--
    Crm-Basic Functions- Text Management-Define Text Determination Procedure - select the Object --
    example for CRM_ORDERH and click on Procedure and select ur text determination procedure --     
    Select  Definition of Procedure that gives u details of  your   text type  and  its  options
    Hope it will Resolve ur problem
    Regards
    Pavan.A

  • Inserting text from one JTextpane to another

    How do i insert text from one jTextpane to another with the attributes i used in the first. Please help.

    i'm using a defaultstyleddocument. Also.....if u know
    how i can transfer this data through a
    DataOutputStream to another computer.Hi again,
    DefaultstyledDocument uses a tree-structure with classes in it, that implements the Element-Interface to hold the styles. It is very easy to get the plain text, but what you need to transfer a part of text from one JTextPane with DefaultStyledDocument in it to another with the same document-style in it, is a sequence of (string, AttributSet) - pairs, so you are able to insert them in the destination document by the insertString(...)-method.
    It is easy to get the Element by postion from the document and retrieve the Attributset from it that it uses in that position. I guess, an approach would be, to do the following:
    get the Attributset at the start of the text = AttributSet of the pair
    scan the document until the set changes
    extract the string from start to the position right before the set changes = string of the pair
    store the (String,AttributSet)-pair in a Vector
    do this in the same way, but this time the "start" will be the position of the start of the new Attributset that causes the end of the scan above.
    When this is done for the hole text, that is to be transferred, you have a Vector with the String-AttributSet-pairs that you can use to insert them in the other JTextPane by calling the
    insertString(...)-method with this values.
    Tell me, what you are thinking about that - I don't know another method for this and had to create a solution on the fly for you, so that is perhaps not the best way to do it.
    greetings Marsian

  • How can I copy/paste text from one page to another?

    I feel like I am taking crazy pills... is there really no way to copy a text box (or group) from one page to another while creating books in Aperture 3?  Lets say I have my entire book laid out and I want to add one paragraph at the end on one page which will push text and photos down a half page or so... in most programs for the last decade or so they added really cool functionality... cut/paste...  It seems like the apple developers are aware of it because they are in the context menus but they don't work on text, only photo boxes.  Additionally, you can copy/paste text but it erases all formatting.
    Seriously, am I missing something?  I have trouble believing that they can't include this function.
    Anyone else have this issue?

    Update... it seems to only happen with text boxes which I create.  So when I try an existing theme I can cut/copy/paste just fine, but in that same theme if you edit the layout and add a new text box, I can't copy paste it anywhere... the options are in the menu but nothing happens.
    Thoughts? Solutions?
    I am running 3.4.3 on a MacBook Pro OS X 10.8.3

  • Edit Text from one screen to another screen

    Hi Experts,
           Here I am having two doubts in doing functionality on SMP 2.3,The below mentioned are the doubts,
                       1. In SMP 2.3 Version,When i am doing Hybrid App Designer in that  Edit Text functionality to pass the values from one screen to another screen,we want to type any text or digits in edit text keypad options is not opening in that field.If any one knows to handle that issue please let me know experts.
                       2.  In SMP 2.3 Version,When i am doing Hybrid App Designer we are taking some labels or buttons or edit box etc....,first time i am generating the hybrid app it is displaying in the mobile device what ever i give in that screen.Afterwards when i am updating second time in that screen with extra functionality labels or buttons or edit box etc...,and generating hybrid app,these time it is not displaying in mobile device which i gave not updating.If any one knows to handle that issue please let me know experts.
         For these both isssues if anybody gets solutions to handle these data please let me know and if links are there please provide it .
    Thanks & Regards,
      Lokesh Reddy G,
      9700414490.

    Hi Lokesh,
    Regarding your queries:
    1. What kind of device/simulator and OS you are testing your app? What is its version?
    Can you share the snapshots as well?
    2. What extra functionality you have added 2nd time? When you generating hybrid app 2nd time is it uploading in HWC container successfully?
    Meanwhile you can check this blog
    A workflow Application to Release A Purchase Order...
    Rgrds,
    Jitendra

  • I want to send data from One server to another

    Hi all,
    My requirement to send data from one server's  application server path(data in one directory in Al11 of the source server) to another server's application server(TO another directory in Al11 transaction of the destination server).
    What are all the ways to achieve this task.
    Thanks in Advance.
    Raja

    While the FTP option mentioned above is workable, both servers should have some form of FTP service running with reference to this solution.
    I suggest two more options, just to give you an idea. I am not getting into details as it is important to get the big picture first before working on details.
    1: Through RFC destinations:
    You can define two RFc destinations, each pointing to the specific application server. Assuming the server names are SOURCE and TARGET, you can have two RFC destinations where you differentiate the servers by specifying the host name or IP address.
    Once the destinations are defined, you need to develop two RFC enabled function module, one will be used to read the file and return it in form of internal table. The other will be get the internal table as input and should save it on server (using abap commands open dataset etc.)
    Now you can have an ABAP program where you first call the function which is reading the file. In call function you mention the RFC destination of source server.
    Once the file is read, you than call the second function module with destination to target server and save the internal table to a file.
    2: Through Background job programming
    While scheduling a background job, you can specify target system which forces the background job to run on that target application server. The basic idea here is to have two abap programs, one would be used to read file and export it to database table like INDX (we can call it ZPRG1), the other will import from the table INDX and write it as a file (we can call it ZPRG2).
    Now you can define a job through SM36, using ZPRG1 as program, and target system as the first application server. This job you can schedule to run periodically.
    Also define a second job through SM36, using ZPRG2 as program and target system as the second application server. For this job, the starting condition you can put as ‘After completion of job1’.
    Another method one can be by using FMs used in tcode SM49 but for that I think your sysadmin might have to create a batch file/script first. Which you can later call from ABAP.
    Cheers.

Maybe you are looking for

  • CD Drive Won't Recognize DVDs or Burn CDs

    I have a white MacBook. My CD Rom will read CDs and I can get content off of CDs. However, I am not able to burn CDs. It recognized the CD and the burn process starts, but then the CD is spit out. Also, it doesn't recognized DVDs, it tries to read it

  • Edit titles in VOB video files

    I created a dvd from still images made into a slideshow in Photoshop 10 and imported to Premier Ele. 10.  the images are of fungi and each fungi has a "title" added to name the fungi.  This burned to a DVD to play on widescreen HD TV.  Some of the "t

  • -3403D error when attempting Apple Hardware Test

    Hi everyone, I want to perform an Apple Hardware Test. I restarted, pressed option+D, and a globe appeared. After a minute, however, the following text appeared: Apple.com/support -3403D

  • How to set ref_to_message_id in the abap proxy

    Hi, Does anyone have idea, how to set ref_to_message_id of a client proxy in the server proxy? My problem is, I send a message to a server proxy. The server proxy receives the message, retrieves the message id and tries to set the ref_to_message_id o

  • Iphoto on yosemite crashes when trying to update old photo library

    Hi there, I have a Imac 24" from 2008 with 3.06 GHz Intel Core 2 Duo processor, 4GB memory. I just upgraded to Yosemite 10.10.1 The iphoto library was old so I downloaded the iphoto library upgrader as instructed and ran it on Iphoto Library (made a