File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Problem regarding setting the value to Jtextarea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem regarding setting the value to Jtextarea" Watch "Problem regarding setting the value to Jtextarea" New topic
Author

Problem regarding setting the value to Jtextarea

d v lokesh venkata
Greenhorn

Joined: Aug 09, 2013
Posts: 16

i am having two frame in which both are having text area each. i tried of doing like whenever i enter data into frame 1 text area and press the button in taht frame the data should be sent to second and that data should be appended into text area of second frame. i had tried it but the data is transferring from one frame to other and displaying in console and also displaying in joptionpane but not in the text area. i tried using networking concept also but it doe snot work
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10170
    
    8

You will have to provide more details here. Where are those two frames? Same machine? On different machines connected over the network?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Sam Gooding
Ranch Hand

Joined: Dec 06, 2013
Posts: 35
I't s what Maneesh said- you're going to have to provide more details in order to get a good answer. I'll try offer one that might not be so good !

Each of the "frames" you're talking about has to have a JTextArea (at least) in it since "frames" i.e. JFrames don't support the presentation of text.
Then if what you want is to have text you type into one "frame" show up in another frame after you push a button, you need to be familiar at least these concepts;


TextComponents
http://docs.oracle.com/javase/tutorial/uiswing/components/text.html

DocumentListeners
http://docs.oracle.com/javase/tutorial/uiswing/events/documentlistener.html

Eventhandlers
http://docs.oracle.com/javase/tutorial/uiswing/events/index.html


Basically, you're going to write an action listener that retrieves the text from the document model of one text area, puts it in the document model of another text area then fires a document changed event on that second text area so it shows the new text. No details provided on purpose including what classes to use. That's what it sounds like like you want to do. That's about how you'd do something about like that. I can be more specific when you can, deal? Deal.

Generally, the Swing tutorial at Oracle's site is your best friend right now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem regarding setting the value to Jtextarea
 
Similar Threads
command prompt output to text area
Display a textbox after dropdown change
Problems with multiple JInternalFrames
Design consideration
refresh data on a GUI from another GUI