import java.awt.*;
import java.applet.Applet;
public class PanelUse extends Applet
{
  	Panel pn2 = new Panel();
  	Panel pn1 = new Panel();
  	GridLayout grd = new GridLayout (2,2,4,4);
  	BorderLayout bdr = new BorderLayout (4,4);
  	Button bt10 = new Button ("10");
  	Button bt20 = new Button ("20");
  	Button bt30 = new Button ("30");
  	Button bt40 = new Button ("40");
  	Button bt2 = new Button ("2");
  	Button bt4 = new Button ("4");
  	Button bt6 = new Button ("6");
  	Button bt8 = new Button ("8");
  	public void init()
  	{
		pn1.setLayout (grd);
		pn2.setLayout (bdr);
		pn1.add(bt10); pn1.add(bt20);
		pn1.add(bt30); pn1.add(bt40);
		pn1.setBackground (Color.blue);
		pn2.add("South",pn1);
		pn2.add("West",bt2); 
		pn2.add("East",bt4);
		pn2.add("North",bt6); 
		pn2.add("Center",bt8);
		pn2.setBackground (Color.green);
		add (pn2);
  	}
}

Click here to go back.

Our aim is to provide information to the knowledge seekers. 


comments powered by Disqus




Footer1