1

I am trying to create a nested layout that contains the flow layout inside of a boarder layout. I have no idea how to do nested layout, thanks in advance.

heres my flow layout

import java.awt.*;
import java.applet.Applet;

public class flowLayout extends Applet{
    Button b1, b2, b3, b4, b5;

    public void init(){
        b1 = new Button("first");
        b2 = new Button("second");
        b3 = new Button("third");
        b4 = new Button("fourth");
        b5 = new Button("fifth");

        add(b1);
        add(b2);
        add(b3);
        add(b4);
        add(b5);
    }
}

heres my border layout

import java.awt.*;
import java.applet.Applet;

public class borderLayout extends Applet {
    public void init() {
        setLayout(new BorderLayout());
        add(new Button("North"), BorderLayout.NORTH);
        add(new Button("South"), BorderLayout.SOUTH);
        add(new Button("East"), BorderLayout.EAST);
        add(new Button("West"), BorderLayout.WEST);
        add(new Button("Center"), BorderLayout.CENTER);
    }
}
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
reckless
  • 67
  • 2
  • 12
  • 1
    check [this](http://vip.cs.utsa.edu/classes/java/tutorial/layouts.html) out – iuq Apr 18 '15 at 20:28
  • 1
    1) Why code an applet? If it is due to the teacher specifying it, please refer them to [Why CS teachers should **stop** teaching Java applets](http://programmers.blogoverflow.com/2013/05/why-cs-teachers-should-stop-teaching-java-applets/). 2) Why use AWT? See [this answer](http://stackoverflow.com/questions/6255106/java-gui-listeners-without-awt/6255978#6255978) for many good reasons to abandon AWT using components in favor of Swing. – Andrew Thompson Apr 19 '15 at 03:22
  • 1
    *"I have no idea how to do nested layout, .."* Typically they would involve one panel inside another, as opposed to collections of frames or applets. – Andrew Thompson Apr 19 '15 at 03:23

0 Answers0