This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
One way to do this is to have a class with an instance variable called "buttons" (which references an array of JButtons) and an instance method called "makeButtons" (which takes an int value, instantiates the array to that size, and fills it with new JButton references).
So where would you put an instance variable and an instance method?