ActionListener on a JButton created from vector?

IntProjet. B refers to the last button created in your loop, so the result is expected. Instead, you can give each button its own instance of a listener, as shown here .

You are continually reassigning the value of be in that loop. When the loop completes, the last JButton to be created is assigned to it. You then bind an ActionListener to that button, but none of the others.

I'm not sure why you expected a single invocation of intProjet.b. AddActionListener() to add it to all JButtons.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions