• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to access TextField  RSS feed

 
Renuka Kilambi
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am creating a class which extends JFrame. I am putting various components in its constructor. One component among them is a TextField named as tf. when a button is clicked,the text from the TextField must be fetched in to another TextField. When I am compiling this , compiler is complaining about not able to recognize tf1. I am not understanding this. Could any body tell me what is happening.
Thanks in advance
Renuka
 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Renuka,
I think u r declaring the components (textfield) inside some method/constructor. u should declare ur GUI components as class variables.may be this will solve your problem
regards
deekasha
 
Renuka Kilambi
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.It worked.
Renuka
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!