I am frantically trying to learn Java and have now found myself wondering if I am passing variables back from a temporary child dialog back to the caller correctly. If somebody would be so good, I would appreciate it if you could look at my example classes and tell me if I am doing it correctly. If not, why not!

For this example, in C++ I would probably pass in a pointer and have the caller updated that way but of course Java doesn't support primitive type pointers. 8-x

Yes, it does, works perfectly! I was really thinking about best practice.

Thank you

October 5th, 2011, 09:38 AM

KevinWorkman

Re: Getting data back from a child form

Quote:

Originally Posted by ishtar

Hi, thank you.

Yes, it does, works perfectly! I was really thinking about best practice.

Thank you

I really wouldn't worry about best practices at this point. If it works, and if you understand why it works, that's probably good enough for now. No matter what code you write, in six months you're going to look back and wonder what you were thinking.

That being said, I think returning something in the way outlined in the tutorial I gave you is the best practice. At the very least, you might want to call a set function instead of accessing the variable directly.