Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to change attribute value of one class from second class

 
Vishnu Sharma
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a requirement, in which i need to do this. Let me cler by this example: I have two files, A.java & B.java, A file contains one textfield, txt. I need to set the value of txt as null, but from B file. Both of these files are in same package Miniproject of c drive.
Please suggest me the appropriate. Thanks in advance.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
B does not extend A, right ? You could have a public setter method in A, which sets the textfield to null.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic