I have added a container named btnBar
with boxlayout(x-axis)
on a form. the container has 4 buttons of custom class MyButton
that extends from Button
itself. When i add actionlistener
to one of the buttons in the container it gets invoked for each n every button. Even the actionevent.getsource.gettext
method returns the same value irrespective of the focus. I have added the buttons through an array and m trying to use is something like this:
btns[0].addActionListener(......)
Where am I going wrong?