Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading data from Jtextfield on jpanel on jframe

 
Vilpesh Mistry
Ranch Hand
Posts: 62
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i am not able to read from a jTextfield which is on a jpanel object and this jpanel object is added on the jframe.

jtextfield is static in the class
iam trying to read the jtextfield in the ActionListener

if i remove the jtextfield from jpanel and add the jtextfield on the jframe
i can get the data entered in jtextfield.

please help
thxs
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post your code
 
Vilpesh Mistry
Ranch Hand
Posts: 62
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Nigel for the prompt response,as it made me to go through the code
and i found that the line that adds the panel containing the JTextField on the Container(JFrame) was not present in my code.

i added the panel on the Container and code worked.

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic