91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 23KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-17
  • 語言: Java
  • 標簽: java??

資源簡介

采用文件管理數據的存儲方式,如果希望改成數據庫的存儲方式,那么只需要改變連接的對象就可以實現了,在此就不多做介紹了!

資源截圖

代碼片段和文件信息

import?java.awt.*;
import?java.awt.event.*;
import?javax.swing.*;
import?java.io.*;
import?java.util.*;
public?class?Delete?extends?JPanel?implements?ActionListener
{
Hashtable?基本信息表?=null;
JTextField?學號姓名專業年級出生;
JRadioButton?男女;
JButton?刪除;
ButtonGroup?group=null;
FileInputStream?inOne=null;
objectInputStream?inTwo=null;
FileOutputStream?outOne=null;
objectOutputStream?outTwo=null;
File?file=null;
public?Delete(File?file)
{
this.file=file;
學號?=new?JTextField(10);
刪除?=new?JButton(“刪除“);
學號.addActionListener(this);
刪除.addActionListener(this);
姓名?=new?JTextField(10);
姓名.setEditable(false);
專業?=new?JTextField(10);
專業.setEditable(false);
年級?=new?JTextField(10);
年級.setEditable(false);
出生?=new?JTextField(10);
出生.setEditable(false);
男?=new?JRadioButton(“男“false);
女?=new?JRadioButton(“女“false);
group=new?ButtonGroup();
group.add(男);
group.add(女);
Box?box1=Box.createHorizontalBox();
box1.add(new?JLabel(“輸入要刪除的學號:“JLabel.CENTER));
box1.add(學號);
box1.add(刪除);
Box?box2=Box.createHorizontalBox();?
box2.add(new?JLabel(“姓名:“JLabel.CENTER));
box2.add(姓名);
Box?box3=Box.createHorizontalBox();?
box3.add(new?JLabel(“性別:“JLabel.CENTER));
box3.add(男);
box3.add(女);
Box?box4=Box.createHorizontalBox();?
box4.add(new?JLabel(“專業:“JLabel.CENTER));
box4.add(專業);
Box?box5=Box.createHorizontalBox();?
box5.add(new?JLabel(“年級:“JLabel.CENTER));
box5.add(年級);
Box?box6=Box.createHorizontalBox();?
box6.add(new?JLabel(“出生:“JLabel.CENTER));
box6.add(出生);
Box?boxH=Box.createVerticalBox();

boxH.add(box1);
boxH.add(box2);
boxH.add(box3);
boxH.add(box4);
boxH.add(box5);
boxH.add(box6);
boxH.add(Box.createVerticalGlue());
JPanel?pCenter=new?JPanel();
pCenter.add(boxH);
setLayout(new?BorderLayout());
add(pCenterBorderLayout.CENTER);
validate();
}
public?void?actionPerformed(ActionEvent?e)
{
if(e.getSource()==刪除?||?e.getSource()==學號)
{
String?number=“?“;
number=學號.getText();
if(number.length()>0)
{
try
{
inOne=new?FileInputStream(file);
inTwo=new?objectInputStream(inOne);
基本信息表?=(Hashtable)inTwo.readobject();
inOne.close();
inTwo.close();
}
catch(Exception?ee)
{
}
if(基本信息表.containsKey(number))
{
Student?stu=(Student)基本信息表.get(number);
姓名.setText(stu.getName());
專業.setText(stu.getDiscripling());
年級.setText(stu.getGrade());
出生.setText(stu.getBorth());
if(stu.getSex().equals(“男“))
{
男.setSelected(true);
}
else
女.setSelected(true);
String?m=“確實要刪除該學號學生的全部信息嗎?“;
int?ok=JOptionPane.showConfirmDialog(thism“確認“JOptionPane.YES_NO_OPTIONJOptionPane.QUESTION_MESSAGE);
if(ok==JOptionPane.YES_OPTION)
{
基本信息表.remove(number);
try
{
outOne=new?FileOutputStream(file);
outTwo=new?Objec

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

????.CA....??????4715??2007-10-11?20:43??StudentManagerSystem\Delete.class

????.CA....??????3991??2007-09-30?16:06??StudentManagerSystem\Delete.java

????.CA....???????512??2007-10-11?20:43??StudentManagerSystem\Inquest$1.class

????.CA....??????4236??2007-10-11?20:43??StudentManagerSystem\Inquest.class

????.CA....??????3440??2007-09-30?16:01??StudentManagerSystem\Inquest.java

????.CA....??????5967??2007-10-11?20:43??StudentManagerSystem\ModifySituation.class

????.CA....??????6147??2007-09-30?16:14??StudentManagerSystem\ModifySituation.java

????.CA....??????1130??2007-10-11?20:43??StudentManagerSystem\Student.class

????.CA....???????864??2007-09-30?16:02??StudentManagerSystem\Student.java

????.CA....???????514??2007-10-11?20:43??StudentManagerSystem\StudentManager$1.class

????.CA....??????4210??2007-10-11?20:43??StudentManagerSystem\StudentManager.class

????.CA....??????2763??2007-10-11?20:15??StudentManagerSystem\StudentManager.java

????.CA....??????2757??2007-09-30?16:21??StudentManagerSystem\StudentManager.java.bak

????.CA....??????4867??2007-10-11?20:43??StudentManagerSystem\StudentSituation.class

????.CA....??????4478??2007-09-30?16:19??StudentManagerSystem\StudentSituation.java

????.CA....?????????0??2007-09-17?15:03??StudentManagerSystem\基本信息.txt

?????目錄??????????0??2008-04-23?13:35??StudentManagerSystem

-----------?---------??----------?-----??----

????????????????50591????????????????????17


評論

共有 條評論