Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Get JTextField value from different class  RSS feed

 
Kevin Ng
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all members,
I'm facing a problem which is related with passing the data/value. This is to get the JTextFields value from class A and transfer to class B so JTextField of class B will having the same value with class A which is key-in by the user.
THANK YOU VERY MUCH.....
Regards,
Kevin Ng
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand what you are trying to accomplish, then in class "A" you use "myField.getText()" to get the text. Pass the text value to class "B" where you would do a "myOtherField.setText()" with that value. Of course "myField" and "myOtherField" are instances of JTextField in the two classes. Is this what you are asking for?
 
Kevin Ng
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Wayne L Johnson,
Yup, exactly....so can you show me how to get value by using JTextField??
THANK YOU....
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!