I have a semi-theoretical problem involving Java and Swing. Swing components contain two options to respond to the user: setAction
and addActionListener
. These pertain to the Action
and ActionListener
objects, respectively.
My question is: which method, setAction
or addActionListener
, should I use? And how are they different from each other?