Hi all,
I want to invoke a method in class A from B like delegate in C# but i do not know how. I googled but i could not find any solutions to resolve my issue. Can any one help me to resolve thi problem.
Thanks.
Tra Thanh Cao
Printable View
Hi all,
I want to invoke a method in class A from B like delegate in C# but i do not know how. I googled but i could not find any solutions to resolve my issue. Can any one help me to resolve thi problem.
Thanks.
Tra Thanh Cao
Perhaps you could have A implement an interface.
Otherwise, describe what you are trying to do. (rather than how you are trying to do it.)
Also - this isn't an AWT/Swing question. I'll move it to New to Java.
I have 2 classes named class A and class B
In class A i create a jlabel named username
In class B i create a button. All what i want is when i click on the button in class B i want to set text or do something to change text of label in class A.
Please thanks.
Sounds like some sort of listener to me.
A listens for events (in this case a text change or some sort?) fired from B.
I agree: add an action listener to the button (rather than assigning to the delegate).