Social Icons

Wednesday, 4 December 2013

calculator Structure in java Applet

import java.awt.*;
import java.awt.event.*;
import java.applet.*;


/*<applet code="carry" width="300" height= "300"></applet>*/

public class carry extends Applet
{
static final int n=3;
int i,j,k;
TextField x;


public void init()
{





setLayout(new BorderLayout());
add(new TextField(15),BorderLayout.NORTH);
setLayout(new FlowLayout(FlowLayout.LEFT));
setFont(new Font("SansSerif",Font.BOLD,30));

add(new Button("+"));
add(new Button("-"));
add(new Button("*"));
add(new Button("/"));


for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
   {
   k=i*n+j;
   if(k>0)
  add(new Button(""+k));
    }

}


}

}

No comments:

Post a Comment

 

Sample Text

Sample text

 
Just Programming Cse DriveReputation Management