• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set Value from 1 frame to another ?

 
tee ming
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need visibility of frame b and the textfield in frame b in frame a. Then just do setText() like normal.
 
tee ming
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic