Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check that the variable in a different class has been updated?

Not sure if this has been asked before, it's a bit difficult to explain.

I have 2 classes, Class A and Class B

Class A creates an instance of Class B (which is a dialog box using JDialog). The user is then asked for text input (stored in a String variable).

How do I tell Class A that the user has now updated the variable and get a copy of it?

Using Java Swing btw,

Thanks

T

like image 615
user913059 Avatar asked Jan 20 '12 09:01

user913059


1 Answers

In general, Observer Pattern deals with such cases

like image 168
isah Avatar answered Oct 17 '22 19:10

isah