This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Not sure I understand this question?...I took your second block of code and looked through it.....what APPEARED to be the issue is that you never retrieved the content pane and then added the panel to that...
I say appeared as I added the two lines of code and it functioned.
The second code block was just adding in that you listed yellow twice so you would have only ever gotten two buttons.