How to reference a JButton with a string (or an integer)? : Let's say we have 3 JButtons(or some other objects) : 

JButton button1 = new JButton() , button2 = new JButton(), button3 = new JButton(); 

Now let's say that as a result of some function we have an integer from 1 to 3. Is it possible , for example, to decide what button to manipulate based on the given integer. So, if I came up with number 3, to select button3 like this : 

button(3).setIcon(etc..);

Thanks in advance :)



