posted 24 years ago
A frames default layout is BorderLayout, so when you explicitly state setLayout(new BorderLayout()) you are not really doing anything.
The reason all the components don't show up is because with BorderLayout, if you don't specify where to place the items, they will be placed in the "center" position. You didn't specify where you wanted them, so they were all placed in the center position. Since the center position fills the area after NORTH, EAST, SOUTH, and WEST are filled (which in your case there isn't any) only one button will show. Should be the last one you added also.
Change your code from setLayout(new BorderLayout()) to setLayout(New FlowLayout()) and see what you get.
Bill