wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes How to set Value from 1 frame to another ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to set Value from 1 frame to another ?" Watch "How to set Value from 1 frame to another ?" New topic
Author

How to set Value from 1 frame to another ?

tee ming
Greenhorn

Joined: Jul 11, 2001
Posts: 8
I am having 2 Frame. Frame A and Frame B. Frame A is having a text Field and a button. When i click on the button on the Frame A, how can p*** the value inside the text field of Frame A into a text Field of Frame B which already prepared. Please help !
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
You need visibility of frame b and the textfield in frame b in frame a. Then just do setText() like normal.
tee ming
Greenhorn

Joined: Jul 11, 2001
Posts: 8
Hi Paul,
Thanks for yr reply. But can you show how to make the frame for A visible to Frame B. Maybe you may write some sample code. Thank You !
tee ming
Greenhorn

Joined: Jul 11, 2001
Posts: 8
Hi,
Seems like u r not really undertand my real problem. Below is the details of my probelm.
I have two JFrames in my application . From the first frame when
I click the "Find" Button the second frame is instantiated which
queries for the value to be found . My intention is that when I
click find on the second Frame all other Column values(from the
database) should be dispalyed in the First frame corresponding
to the value I am searching. I am calling the set method in the
first frame from the second frame to dispaly the values in the
first frame. But this is not getting displayed in the first
frame even though i am able to get the result printed in the
console window.
Hope you can be more understand and help me to solve the problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set Value from 1 frame to another ?
 
Similar Threads
Text field default value
How to redirect to same page in struts 2
Setting JButton's Height
Getting data from one frame into another
passing value between frames