Professional Documents
Culture Documents
Code 2
Code 2
Code 2
*;
Connection con; String str=""; int a[]=new int[100]; int[] pv1=new int[50]; int i=0,j=0;
/* Button b1=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b2=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b3=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b4=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b5=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b6=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b7=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b8=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b9=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b10=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b11=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b12=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b13=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b14=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b15=new Button(Integer.toString(rnumber.nextInt(99)+1)); Button b16=new Button(Integer.toString(rnumber.nextInt(99)+1)); */
Button bb=new Button("B"); Button bc=new Button("C"); Button bd=new Button("D"); Button be=new Button("E"); Button bf=new Button("F"); Button bg=new Button("G"); Button bh=new Button("H"); Button bi=new Button("I"); Button bj=new Button("J"); Button bk=new Button("K"); Button bl=new Button("L"); Button bm=new Button("M"); Button bn=new Button("N"); Button bo=new Button("O"); Button bp=new Button("P");
public Form112() {
// tx2.setEchoChar('*'); tx3.setEchoChar('*');
setLayout(new FlowLayout(FlowLayout.CENTER));
Panel p1=new Panel(); Panel p2=new Panel(); Panel p3=new Panel(); Panel p4=new Panel(); Panel p5=new Panel(); Panel p6=new Panel();
p1.setLayout(new GridLayout(4,4,1,1)); p4.setLayout(new GridLayout(4,4,1,1)); p5.setLayout(new GridLayout(4,4,1,1)); p6.setLayout(new GridLayout(4,4,1,1)); p2.setLayout(new FlowLayout(FlowLayout.CENTER)); p3.setLayout(new GridLayout(1,2,15,5));
b7.addActionListener(this); b8.addActionListener(this); b9.addActionListener(this); b10.addActionListener(this); b11.addActionListener(this); b12.addActionListener(this); b13.addActionListener(this); b14.addActionListener(this); b15.addActionListener(this); b16.addActionListener(this);
ba.addActionListener(this); bb.addActionListener(this); bc.addActionListener(this); bd.addActionListener(this); be.addActionListener(this); bf.addActionListener(this); bg.addActionListener(this); bh.addActionListener(this); bi.addActionListener(this); bj.addActionListener(this); bk.addActionListener(this); bl.addActionListener(this); bm.addActionListener(this); bn.addActionListener(this);
bo.addActionListener(this); bp.addActionListener(this);
addWindowListener(this);
p2.add(lb1); p2.add(tx1);
p5.add(lb3); p5.add(tx3);
/*
p4.add(lb2); p4.add(tx2); */
/*
p1.add(b1); p1.add(b2); p1.add(b3); p1.add(b4); p1.add(b5); p1.add(b6); p1.add(b7); p1.add(b8); p1.add(b9); p1.add(b10); p1.add(b11); p1.add(b12); p1.add(b13); p1.add(b14);
p1.add(b15); p1.add(b16); */
p3.add(login_button); p3.add(reset_button);
try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:krishna2");
catch(Exception e) { System.out.println(e); }
//--------------------------------------------------------------------------------------
/*----------------------Event Handling--------------*/
{ String tname=tx1.getText();
int j=0;
System.out.println("\npv values"); System.out.println("no.of values = "+pv.length); for(int i=1;i<pv.length;i++) System.out.println(" "+pv[i]+" ");
pv1[i]=11;
else if(pv[i].equals("B"))
pv1[i]=12;
else if(pv[i].equals("C"))
pv1[i]=13;
else if(pv[i].equals("D"))
pv1[i]=14;
else if(pv[i].equals("E"))
pv1[i]=21;
else if(pv[i].equals("F"))
pv1[i]=22;
else if(pv[i].equals("G"))
pv1[i]=23;
else if