Pegun
Golden Member
Hey all, I am having a minor problem. I am creating a program where there are three buttons in the upper left hand corner and now i want three under those. When i create a panel, it makes it so that the three buttons are right next to the first three though. How can i modify my coding to make this possible?
Panel buttonPanel = new Panel(new FlowLayout(FlowLayout.LEFT));
topPanel.add(buttonPanel); //original panel
circle = new Button("Circle");
buttonPanel.add(circle);
roundRec = new Button("Rounded Rectangle");
buttonPanel.add(roundRec);
threeDRec = new Button("3D Rectangle"); //first three buttons
buttonPanel.add(threeDRec);
Panel secondPanel = new Panel(new FlowLayout(FlowLayout.LEFT));
topPanel.add(secondPanel); //second panel
line = new Button("Line");
buttonPanel.add(line);
oval = new Button("Oval");
buttonPanel.add(oval);
square = new Button("Square");
buttonPanel.add(square); //next three buttons
clear = new Button("Clear");
buttonPanel.add(clear);
Panel buttonPanel = new Panel(new FlowLayout(FlowLayout.LEFT));
topPanel.add(buttonPanel); //original panel
circle = new Button("Circle");
buttonPanel.add(circle);
roundRec = new Button("Rounded Rectangle");
buttonPanel.add(roundRec);
threeDRec = new Button("3D Rectangle"); //first three buttons
buttonPanel.add(threeDRec);
Panel secondPanel = new Panel(new FlowLayout(FlowLayout.LEFT));
topPanel.add(secondPanel); //second panel
line = new Button("Line");
buttonPanel.add(line);
oval = new Button("Oval");
buttonPanel.add(oval);
square = new Button("Square");
buttonPanel.add(square); //next three buttons
clear = new Button("Clear");
buttonPanel.add(clear);