Im pretty new to gui programming so i've been reading through every post on this site about swing and design. Whats been answered over and over again is that one should have a multiton class for the actions. Like this: (GUI
being some JFrame
)
Now, this works great for one-way actions, like OpenDialog. But the actions for buttons in DialogA
and B
will have to have access to all the components (there will be many) in its dialog, and the controller
. This is where im stuck.
The only sane way i can see is to put it in DialogA/B
but i would then need to pass the controller
all the way down, through classes that dont even need it, and it'll get all spaghetti. Really dont want that.
Someone must have encountered this problem before. So where should i put this Action
? Or should i just drop the whole design?
Edit: got a good answer from elsewhere. Resolved.