Beginner question here.
I've written a couple of different
applets for web sites I do, and I've gotten the same little design problem with both - I want a frame to pop up that gets information from the user, that then modifies the variables in the main object (the one that extends Applet). And I'm left with the question, what's the best way to ensure my secondary frame has access to those variables. I do it one of two ways:
a) make it an inner class, so it has all the access it needs
b) make it a helper class, with a constructor that takes a reference to my main object (the one that extends Applet) as an argument.
Both of these seem to have their problems. When I have a bunch of these secondary frames, I feel like the main object gets cluttered. But I'm not used to seeing the second one done, so I would suspect there's some reason for that.
Is there a common solution to this? Is there something I should read that covers stuff like this?
Thanks
Eric