資源簡(jiǎn)介
java 學(xué)生成績(jī)管理系統(tǒng) 源代碼
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.lang.*;
public class Students.java extends Applet implements ActionListener
{
Vector StuInf=new Vector();
StudentInf SI;
String xm;
String bj;
int i,j,xh,cj;
static int mid;
Label prompt1=new Label("學(xué)生成績(jī)管理系統(tǒng)");
Label prompt2=new Label(" 用戶:");
Label prompt3=new Label(" 密碼:");
Label prompt4=new Label(" 班級(jí):");
Label prompt5=new Label(" 成績(jī):");
TextField input1=new TextField(8);
TextField input2=new TextField(8);
TextField input3=new TextField(8);
TextField input4=new TextField(8);
Button btn1=new Button("登錄");
Button btn2=new Button("增加");
Button btn3=new Button("修改");
Button btn4=new Button("刪除");

代碼片段和文件信息
import?java.applet.applet;
import?java.awt.*;
import?java.awt.event.*;
import?java.util.*;
import?java.lang.*;
public?class?Students.java?extends?applet?implements?ActionListener?
{
?Vector?StuInf=new?Vector();
?StudentInf?SI;
?String?xm;
?String?bj;
?int?ijxhcj;
?static?int?mid;
?Label?prompt1=new?Label(“學(xué)生成績(jī)管理系統(tǒng)“);
?Label?prompt2=new?Label(“???用戶:“);
?Label?prompt3=new?Label(“???密碼:“);
?Label?prompt4=new?Label(“???班級(jí):“);
?Label?prompt5=new?Label(“???成績(jī):“);
?TextField?input1=new?TextField(8);
?TextField?input2=new?TextField(8);
?TextField?input3=new?TextField(8);
?TextField?input4=new?TextField(8);
?Button?btn1=new?Button(“登錄“);
?Button?btn2=new?Button(“增加“);
?Button?btn3=new?Button(“修改“);
?Button?btn4=new?Button(“刪除“);
?public?void?init()
?{
??setLayout(new?GridLayout(63));
??add(new?Label());
??add(prompt1);
??add(new?Label());
??add(prompt2);
??add(input1);
??add(new?Label());
??add(prompt3);
??add(input2);
??add(btn1);
??add(prompt4);
??add(input3);
??add(new?Label());
??add(prompt5);
??add(input4);
??add(new?Label());
??add(btn2);
??add(btn3);
??add(btn4);
??prompt4.setVisible(false);
??prompt5.setVisible(false);
??input3.setVisible(false);
??input4.setVisible(false);
??btn2.setVisible(false);
??btn3.setVisible(false);
??btn4.setVisible(false);
??btn1.addActionListener(this);
??btn2.addActionListener(this);
??btn3.addActionListener(this);
??btn4.addActionListener(this);
?}
?public?void?actionPerformed(ActionEvent?e)
?{
??if(e.getActionCommand()==“登錄“)
??{
???String?ab;
???a=input1.getText();
???b=input2.getText();
???input1.setText(““);
???if((a.equals(“12“)==true)&&(b.equals(“12“)==true))
???{
????prompt2.setText(“???姓名:“);
????prompt3.setText(“???學(xué)號(hào):“);?
????prompt4.setVisible(true);
????prompt5.setVisible(true);
????input3.setVisible(true);
????input4.setVisible(true);
????btn2.setVisible(true);
????btn3.setVisible(true);
????btn4.setVisible(true);
????btn3.setEnabled(false);
????btn4.setEnabled(false);
????btn1.setLabel(“查詢“);
????input1.setText(“登錄成功“);
????input1.selectAll();
???}
???else
???input2.setText(“用戶名或密碼錯(cuò)“);
??}
??if(e.getActionCommand()==“增加“)
??{
???boolean?scucss=true;
???try
???{
????XingMing();
???}
???catch(EmptyException?as)
???{
????input1.setText(“姓名不能為空“);
????scucss=false;
???}
???try
???{
????xh=Integer.parseInt(input2.getText());
???}
???catch(NumberFormatException?m)
???{
????input2.setText(“學(xué)號(hào)為空或格式錯(cuò)“);
????scucss=false;
???}?
???bj=input3.getText();
???try
???{
????ChengJi();
???}
???catch(EmptyException?as)
???{
????cj=-1;
???}
???catch(OverException?dd)
???{
????input4.setText(“應(yīng)在0-100間“);
????scucss=false;
???}
???catch(NumberFormatException?cm)
???{
????input4.setText(“成績(jī)應(yīng)為數(shù)據(jù)“);
????scucss=false;??
???}
???if(scucss==true)
???{
???SI=new?StudentInf(xmxhbjcj);
???Insert(SI);
???}
??}
??if(e.getActionCommand()==“修改“)
??{
???xm=input1.getText();
???xh=Integer.pars
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????6534??2009-10-14?18:04??9.java
-----------?---------??----------?-----??----
?????????????????6534????????????????????1
評(píng)論
共有 條評(píng)論