English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Where is the best place to put an ActionListener? Inside the object that uses it? Inside the container object that it resides in? Inside the main() object?

2007-03-04 10:10:03 · 1 answers · asked by MistWing 4 in Computers & Internet Programming & Design

1 answers

When I write swing programs, I generally make a seperate class, something like ActionListener that listens for action events. Then I have logic in the class that figures what object (JButton, etc) registered the event and then run a method that performs the action. Good luck!!

2007-03-04 10:14:10 · answer #1 · answered by rowancompsciguy 3 · 0 0

fedest.com, questions and answers