Write to static field from instance method

instance method writes to a static field. This is tricky to get correct if multiple instances are being manipulated, and generally bad practice.

public static loadingDialog StatusWndw = null;

StatusWndw = new loadingDialog(this);

iwant to acces this satic field out side the class.

how to slove this problem

[338 byte] By [pankaj.upadhyaya] at [2007-11-27 11:02:53]
# 1

use a static method.

subhashmedhia at 2007-7-29 12:46:12 > top of Java-index,Java Essentials,Java Programming...
# 2

Make the LoadingDialog a singleton class. Lookup the singleton pattern.

gimbal2a at 2007-7-29 12:46:12 > top of Java-index,Java Essentials,Java Programming...