views:

67

answers:

2

Hi, I'm using NetBeans IDE to create a system.

I created an instance of a class, then I want to access this instance from a different JSwing Form. I declared the class as public, but it still doesn't recognize the instance.

Any help?

Regards..

+2  A: 

you need to pass this instance to your Form either in Form Constructor or by a method.

or you can make class (class of your instance) a singleton class and use a single instance in your forms.

mohammad shamsi
+1  A: 

Looks like you need static fields and/or methods in your class.

Daniel