Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Grid Java source code
#1

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

/*
<applet code="Grid" width=380 height=150>
</applet>*/

public class Grid extends Applet implements ActionListener
{

String msg;
TextField tf1,tf2,tf3,tf4,tf5,tf6;
TextArea tf7;
Label lb1,lb2,lb3,lb4,lb5,lb6,lb7,lb8,lb9,lb10,lb11,lb12,lb13;
Button b;


public void init()
{

  setLayout(new GridLayout(7,3));

  tf1 = new TextField(20);
  tf2 = new TextField(10);
  tf3 = new TextField(20);
  tf4 = new TextField(5);
  tf5 = new TextField(5);
  tf6 = new TextField(40);
  tf7 = new TextArea(10,50);

  
  lb1 = new Label("Name",Label.RIGHT);
  lb2 = new Label("Class",Label.RIGHT);
  lb3 = new Label("RollNo",Label.RIGHT);
  lb4 = new Label("Marks1",Label.RIGHT);
  lb5 = new Label("Marks2",Label.RIGHT);
  lb6 = new Label("Record",Label.RIGHT);
  lb7 = new Label("Result");  
  lb8 = new Label(" ");
  lb9 = new Label(" ");
  lb10 = new Label(" ");
  lb11 = new Label(" ");
  lb12 = new Label(" ");
  lb13 = new Label(" ");

  b = new Button("SUBMIT");

  add(lb1);
  add(tf1);
  add(lb8);
  add(lb2);
  add(tf2);
  add(lb9);
  add(lb3);
  add(tf3);
  add(lb10);
  add(lb4);
  add(tf4);
  add(lb11);
  add(lb5);
  add(tf5);
  add(lb12);
  add(lb13);
  add(b);
  add(lb7);
  add(tf6);
  add(lb6);
  add(tf7);

  b.addActionListener(this);

  

}

  
public void actionPerformed(ActionEvent ae)
{

  int k = Integer.parseInt(tf4.getText())+
  Integer.parseInt(tf5.getText());
  msg = tf1.getText() +tf2.getText()+
  tf3.getText()+tf4.getText()+tf5.getText();
  tf7.append( msg);

  if(k > 50)
  {  
  tf6.setText("pass");
  }
  else
  {
  tf6.setText("Fail");
  }
  
}

}
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: java source code for grid technology for image rendering, java code for hotel management java or code hotel management in java file type java, ppt for grid computing ppt for grid computing of topic grid security, grid computing projects source code in java on load balancing, ant colony optimization for grid scheduling source code in java, load balancing in grid computing source code in java, hospital database java netbeans source code hospital database java netbeans source code,

Forum Jump:


Users browsing this thread: 1 Guest(s)