• Post Reply Bookmark Topic Watch Topic
  • New Topic

pass value between frames  RSS feed

 
eric sato
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
Im not sure this question is regards to Java or Swing section. The problem i encountered is how to set the value in Frame B jTextFieldB from frame A, jTextFieldA. any ideas to start ?
thanks in advance.
best regards,
sato
 
Lalit K Kumar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi eric,
there r two ways to do it. the first one is to create your own property. set that property to the text of textfield in your first frame.
then in your second frame access that property.
second way is that you pass the value of the textfield (of first frame)to the constructor of second. from the constructor of the second do whatever you want to do with it.
mail back for any further queries.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!