20-CS-694 Advanced Programming Techniques Spring 2012
Layouts

Interfaces, Exceptions, Graphics, Animation, Threads, Reflection, Networking, RMI, JDBC, JNI

       Previous     Next     Applet Source     All lectures

BorderLayout

import java.awt.*;
import javax.swing.*;
import java.applet.*;

class BLT extends JFrame {
   public BLT () {
      setLayout(new BorderLayout());
      add("North", new JButton("North"));
      add("South", new JButton("South"));
      add("East", new JButton("East"));
      add("West", new JButton("West"));
      add("Center", new JButton("Center"));
   }
}

public class blt extends Applet {
   BLT b;

   public void init () {
      b = new BLT();
      b.setSize(600,600);
      b.setVisible(true);
   }

   public void finalize() { b.dispose(); }
}