No, you loop through the songs and create a button for each. You add the buttons in order to a panel and Bob's your uncle. Of course, using a correct layout will make that process much much simpler.
ronald deux wrote:if I add two more songs to my song array
and if I understand correctly, we will have to add two more actionListener
it makes more code
Java™ Tutorials link about λs.
I don't understand this symbol λ
There are several more, I am afraid: don't extend display classes unless you need to override any of their methods; the commonest overridden method is probably JPanel#paintComponent().
Carey Brown wrote:. . . . There are several problems. . . . .