import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class BorderLayoutExample extends Applet
{
public static void main(String args[])
{
Frame f = new Frame("BorderLayoutFrame");
Panel p = new Panel();
Button b1 = new Button();
Button b2 = new Button();
Button b3 = new Button();
Button b4 = new Button();
Button b5 = new Button();
f.add(p);
p.setLayout(new BorderLayout());
p.add(new Button("Wel"),BorderLayout.NORTH);
p.add(new Button("Come"),BorderLayout.SOUTH);
p.add(new Button("ROSE"),BorderLayout.EAST);
p.add(new Button("INDIA"),BorderLayout.WEST);
p.add(new Button("ROSEINDIA"),BorderLayout.CENTER);
f.setSize(300,300);
f.setVisible(true);
f.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
}
import java.awt.event.*;
import java.applet.*;
public class BorderLayoutExample extends Applet
{
public static void main(String args[])
{
Frame f = new Frame("BorderLayoutFrame");
Panel p = new Panel();
Button b1 = new Button();
Button b2 = new Button();
Button b3 = new Button();
Button b4 = new Button();
Button b5 = new Button();
f.add(p);
p.setLayout(new BorderLayout());
p.add(new Button("Wel"),BorderLayout.NORTH);
p.add(new Button("Come"),BorderLayout.SOUTH);
p.add(new Button("ROSE"),BorderLayout.EAST);
p.add(new Button("INDIA"),BorderLayout.WEST);
p.add(new Button("ROSEINDIA"),BorderLayout.CENTER);
f.setSize(300,300);
f.setVisible(true);
f.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
}