Hi there, I'm new to java and new to the forums. I find the best way to learn a programming language is to get coding a project you like and start from there so sorry if this question is a really basic concept (I despise reading books thought I'll look at documentation and tutorials for concepts I'm stuck on ).
So now onto the question and not my life story I'm fairly bad at explaining so I'll do it with code;
private void styleButtons(JButton... buttons){ for ( int i=0; i < buttons.length; i++ ) { buttons[i].setBounds(120,10 * (i * 5) + 15, 130, 30); buttons[i].addActionListener(new ButtonListener1()); } }
I have a button called BtnExit and BtnStart I would like it so during the loop it would assign the class BtnExitButtonListener to BtnExit and BtnStartButtonListener to Btn start and so on (hope you get the idea now).
feel free to correct me over my use of technical words and any advice would be really great even if its "your doing it the wrong way".