simple question vector
why the first code doesn't replace the second? i want create an array of buttons where only thing that change is the btnX ---(the name of each button)
JButton btn=new JButton; // ten is an example
JButton btn1 = new JButton("New");
JButton btn2 = new JButton("New");
That's not how arrays work. What are you trying to accomplish? You may not really want an array of JButton objects.
Originally Posted by felito
If you want to create an array of buttons, then use the array. I don't see what your question is.
the problem is that i I was not calling the correct position vector
Solved with btn, btn, ...
thanks for your rime