Calling / Updating class?
Hi guys,
I have 2 classes, two JFrame classes in NetBeans.
The first one has a public Main() and the other has a public Maintain(), from the maintain I'm trying to re-trigger the commands in the public Main() <- the commands that run on the start up of the form.
Can someone help? is there a command round this? thank you (:
Re: Calling / Updating class?
By commands do you mean you want to call the methods in a class?
If you have a reference to the Main class, you can call methods in that class.
For example in one of the Maintain class's methods:
aRefToMain.someMethod(); // call someMethod in the Main class
Here: aRefToMain is a reference to an instance of the Main class and someMethod() is a method in that class.
Re: Calling / Updating class?
Yup I did that but one method runs fine, the other doesnt give me any returns.. and the methods are fine... can it be because it accesses jLabels etc on the form?
Re: Calling / Updating class?
please post your code, then only we can help you!!:confused: