I am currently developing an application. I am using swing to create a GUI. My question revolves around the appropriate use of ActionListeners. Is it more appropriate to create them at the time of the parent component they are listening to as anonymous functions, or would it be better to create a global ActionListener and bind ActionCommands to each component?
At the moment I'm torn because the anonymous usage seems like it would be better adaptable on a per-use basis, but the global strategy seems to make reusable functions easier.
Aucun commentaire:
Enregistrer un commentaire