亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? withdrawmoney.java

?? 利用JBuild編寫的銀行系統管理程序
?? JAVA
字號:
package BankSystem;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;

public class WithdrawMoney extends JInternalFrame implements ActionListener {

	private JPanel jpWith = new JPanel();
	private JLabel lbNo, lbName, lbDate, lbWithdraw;
	private JTextField txtNo, txtName, txtWithdraw;
	private JComboBox cboMonth, cboDay, cboYear;
	private JButton btnSave, btnCancel;

	private int recCount = 0;
	private int rows = 0;
	private	int total = 0;
	private	int curr;
	private	int withdraw;

	//String Type Array use to Load Records From File.
	private String records[][] = new String [500][6];

	private FileInputStream fis;
	private DataInputStream dis;

	WithdrawMoney () {

		// super(Title, Resizable, Closable, Maximizable, Iconifiable)
		super ("Withdraw Money", false, true, false, true);
		setSize (335, 235);

		jpWith.setLayout (null);

		lbNo = new JLabel ("Account No:");
		lbNo.setForeground (Color.black);
		lbNo.setBounds (15, 20, 80, 25);
	        lbName = new JLabel ("Person Name:");
		lbName.setForeground (Color.black);
	        lbName.setBounds (15, 55, 80, 25);
		lbDate = new JLabel ("With. Date:");
		lbDate.setForeground (Color.black);
		lbDate.setBounds (15, 90, 80, 25);
		lbWithdraw = new JLabel ("With. Amount:");
		lbWithdraw.setForeground (Color.black);
		lbWithdraw.setBounds (15, 125, 80, 25);

		txtNo = new JTextField ();
		txtNo.setHorizontalAlignment (JTextField.RIGHT);
		//Checking the Accunt No. Provided By User on Lost Focus of the TextBox.
		txtNo.addFocusListener (new FocusListener () {
			public void focusGained (FocusEvent e) { }
			public void focusLost (FocusEvent fe) {
				if (txtNo.getText().equals ("")) { }
				else {
					rows = 0;
					populateArray ();	//Load All Existing Records in Memory.
					findRec ();		//Finding if Account No. Already Exist or Not.
				}
			}
		}
		);
		txtNo.setBounds (105, 20, 205, 25);

		txtName = new JTextField ();
		txtName.setEnabled (false);
		txtName.setBounds (105, 55, 205, 25);
		txtWithdraw = new JTextField ();
		txtWithdraw.setHorizontalAlignment (JTextField.RIGHT);
		txtWithdraw.setBounds (105, 125, 205, 25);

		//Restricting The User Input to only Numerics in Numeric TextBoxes.
		txtNo.addKeyListener (new KeyAdapter() {
			public void keyTyped (KeyEvent ke) {
				char c = ke.getKeyChar ();
				if (!((Character.isDigit (c) || (c == KeyEvent.VK_BACK_SPACE)))) {
					getToolkit().beep ();
					ke.consume ();
      				}
    			}
  		}
		);
		txtWithdraw.addKeyListener (new KeyAdapter() {
			public void keyTyped (KeyEvent ke) {
				char c = ke.getKeyChar ();
				if (!((Character.isDigit (c) || (c == KeyEvent.VK_BACK_SPACE)))) {
					getToolkit().beep ();
					ke.consume ();
      				}
    			}
  		}
		);

		//Creating Date Option.
		String Months[] = {"January", "February", "March", "April", "May", "June",
			"July", "August", "September", "October", "November", "December"};
		cboMonth = new JComboBox (Months);
		cboDay = new JComboBox ();
		cboYear = new JComboBox ();
		for (int i = 1; i <= 31; i++) {
			String days = "" + i;
			cboDay.addItem (days);
		}
		for (int i = 2000; i <= 2015; i++) {
			String years = "" + i;
			cboYear.addItem (years);
		}

		//Aligning The Date Option Controls.
		cboMonth.setBounds (105, 90, 92, 25);
		cboDay.setBounds (202, 90, 43, 25);
		cboYear.setBounds (250, 90, 60, 25);

		//Aligning The Buttons.
		btnSave = new JButton ("Save");
		btnSave.setBounds (20, 165, 120, 25);
		btnSave.addActionListener (this);
		btnCancel = new JButton ("Cancel");
		btnCancel.setBounds (185, 165, 120, 25);
		btnCancel.addActionListener (this);

		//Adding the All the Controls to Panel.
		jpWith.add (lbNo);
		jpWith.add (txtNo);
		jpWith.add (lbName);
		jpWith.add (txtName);
		jpWith.add (lbDate);
		jpWith.add (cboMonth);
		jpWith.add (cboDay);
		jpWith.add (cboYear);
		jpWith.add (lbWithdraw);
		jpWith.add (txtWithdraw);
		jpWith.add (btnSave);
		jpWith.add (btnCancel);

		//Adding Panel to Window.
		getContentPane().add (jpWith);

		populateArray ();	//Load All Existing Records in Memory.

		//In the End Showing the New Account Window.
		setVisible (true);

	}

	//Function use By Buttons of Window to Perform Action as User Click Them.
	public void actionPerformed (ActionEvent ae) {

		Object obj = ae.getSource();

		if (obj == btnSave) {
			if (txtNo.getText().equals("")) {
				JOptionPane.showMessageDialog (this, "Please! Provide Id of Customer.",
						"BankSystem - EmptyField", JOptionPane.PLAIN_MESSAGE);
				txtNo.requestFocus();
			}
			else if (txtWithdraw.getText().equals("")) {
				JOptionPane.showMessageDialog (this, "Please! Provide Withdraw Amount.",
						"BankSystem - EmptyField", JOptionPane.PLAIN_MESSAGE);
				txtWithdraw.requestFocus ();
			}
			else {
				withdraw = Integer.parseInt (txtWithdraw.getText ());
				if (curr == 0) {
					JOptionPane.showMessageDialog (this, txtName.getText () + " doesn't have any Amount in Balance.",
							"BankSystem - EmptyAccount", JOptionPane.PLAIN_MESSAGE);
					txtClear ();
				}
				else if (withdraw > curr) {
					JOptionPane.showMessageDialog (this, "Withdraw Amount can't greater than Actual Balance.",
							"BankSystem - Large Amount", JOptionPane.PLAIN_MESSAGE);
					txtWithdraw.setText ("");
					txtWithdraw.requestFocus ();
				}
				else {
					editRec ();	//Update the Contents of Array.
				}
			}
		}
		if (obj == btnCancel) {
			txtClear ();
			setVisible (false);
			dispose();
		}

	}

	//Function use to load all Records from File when Application Execute.
	void populateArray () {

		try {
			fis = new FileInputStream ("Bank.dat");
			dis = new DataInputStream (fis);
			//Loop to Populate the Array.
			while (true) {
				for (int i = 0; i < 6; i++) {
					records[rows][i] = dis.readUTF ();
				}
				rows++;
			}
		}
		catch (Exception ex) {
			total = rows;
			if (total == 0) {
				JOptionPane.showMessageDialog (null, "Records File is Empty.\nEnter Records First to Display.",
							"BankSystem - EmptyFile", JOptionPane.PLAIN_MESSAGE);
				btnEnable ();
			}
			else {
				try {
					dis.close();
					fis.close();
				}
				catch (Exception exp) { }
			}
		}

	}

	//Function use to Find Record by Matching the Contents of Records Array with ID TextBox.
	void findRec () {

		boolean found = false;
		for (int x = 0; x < total; x++) {
			if (records[x][0].equals (txtNo.getText())) {
				found = true;
				showRec (x);
				break;
			}
		}
		if (found == false) {
			String str = txtNo.getText ();
			txtClear ();
			JOptionPane.showMessageDialog (this, "Account No. " + str + " doesn't Exist.",
						"BankSystem - WrongNo", JOptionPane.PLAIN_MESSAGE);
		}

	}

	//Function which display Record from Array onto the Form.
	public void showRec (int intRec) {

		txtNo.setText (records[intRec][0]);
		txtName.setText (records[intRec][1]);
		curr = Integer.parseInt (records[intRec][5]);
		recCount = intRec;

	}

	//Function use to Clear all TextFields of Window.
	void txtClear () {

		txtNo.setText ("");
		txtName.setText ("");
		txtWithdraw.setText ("");
		txtNo.requestFocus ();

	}

	//Function use to Edit an Element's Value of the Array.
	public void editRec () {

		records[recCount][0] = txtNo.getText ();
		records[recCount][1] = txtName.getText ();
		records[recCount][2] = "" + cboMonth.getSelectedItem ();
		records[recCount][3] = "" + cboDay.getSelectedItem ();
		records[recCount][4] = "" + cboYear.getSelectedItem ();
		records[recCount][5] = "" + (curr - withdraw);
		editFile ();	//Save This Array to File.

	}

	//Function use to Save Records to File After editing the Record of User Choice.
	public void editFile () {

		try {
			FileOutputStream fos = new FileOutputStream ("Bank.dat");
			DataOutputStream dos = new DataOutputStream (fos);
			if (records != null) {
				for (int i = 0; i < total; i++) {
					for (int c = 0; c < 6; c++) {
						dos.writeUTF (records[i][c]);
						if (records[i][c] == null) break;
					}
				}
				JOptionPane.showMessageDialog (this, "The File is Updated Successfully",
						"BankSystem - Record Saved", JOptionPane.PLAIN_MESSAGE);
				txtClear ();
				dos.close();
				fos.close();
			}
		}
		catch (IOException ioe) {
			JOptionPane.showMessageDialog (this, "There are Some Problem with File",
					"BankSystem - Problem", JOptionPane.PLAIN_MESSAGE);
		}

	}

	//Function use to Lock all Buttons of Window.
	void btnEnable () {

		txtNo.setEnabled (false);
		cboMonth.setEnabled (false);
		cboDay.setEnabled (false);
		cboYear.setEnabled (false);
		txtWithdraw.setEnabled (false);
		btnSave.setEnabled (false);

	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www.日韩大片| 国产成人午夜精品影院观看视频 | 欧美三级一区二区| 成人免费毛片a| 9色porny自拍视频一区二区| 一本色道久久综合亚洲91| av在线一区二区三区| 日本高清视频一区二区| 欧美色综合网站| 精品久久久久久亚洲综合网| 久久婷婷成人综合色| 综合欧美一区二区三区| 视频一区二区三区中文字幕| 韩国av一区二区三区四区| 91色在线porny| 欧美一区二区高清| 中文字幕在线不卡| 一区二区激情视频| 精品中文字幕一区二区小辣椒| 丁香婷婷综合激情五月色| 欧美日韩一卡二卡三卡 | 美女一区二区在线观看| 成人黄色大片在线观看| 91麻豆精品国产自产在线观看一区| 精品久久五月天| 亚洲午夜精品网| www.亚洲色图.com| 精品国产网站在线观看| 石原莉奈在线亚洲二区| 91免费视频观看| 中文字幕一区二区三区av| 卡一卡二国产精品| 精品噜噜噜噜久久久久久久久试看| 亚洲综合激情另类小说区| 成av人片一区二区| 欧美韩日一区二区三区四区| 美女网站色91| 91麻豆精品国产91久久久| 亚洲最新视频在线观看| 99热在这里有精品免费| 亚洲日本在线看| 91美女片黄在线| 亚洲高清视频在线| 欧美日韩日日骚| 日韩欧美国产三级| 《视频一区视频二区| 久久99精品久久久久婷婷| 久久这里只有精品首页| 国产成人小视频| 一区二区三区中文字幕精品精品| 成人av在线网| 亚洲成人综合在线| 色婷婷av一区二区三区软件| 日韩和的一区二区| 欧美sm极限捆绑bd| 国产乱码精品一区二区三区五月婷| 精品国产凹凸成av人网站| 国产一区二区导航在线播放| 一区免费观看视频| 日韩色视频在线观看| 国产成人99久久亚洲综合精品| 亚洲欧洲日本在线| 日韩精品一区二区三区视频播放| 国产一区免费电影| 亚洲777理论| 亚洲欧洲国产日韩| 国产亚洲一二三区| 欧美午夜精品一区二区三区| 黄色成人免费在线| 日韩精品亚洲专区| 亚洲免费av在线| 国产精品久久综合| 日韩免费观看2025年上映的电影| 成年人午夜久久久| 国产麻豆成人传媒免费观看| 午夜精品久久久久久久久| 国产精品成人免费| 国产精品卡一卡二卡三| 久久精品视频在线免费观看| 欧美卡1卡2卡| 欧美剧在线免费观看网站 | 欧美日产在线观看| 日本国产一区二区| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 亚洲午夜久久久久久久久电影网| 国产精品视频yy9299一区| 国产精品日产欧美久久久久| 国产日韩三级在线| 国产精品国产三级国产a| 日本一区二区电影| 亚洲免费视频中文字幕| 夜色激情一区二区| 日本欧美加勒比视频| 五月婷婷欧美视频| 精品夜夜嗨av一区二区三区| 国内精品免费**视频| 成人的网站免费观看| 欧美视频在线播放| 精品久久久久久无| 中日韩av电影| 亚洲一区二区三区小说| 亚洲精品视频免费看| 奇米777欧美一区二区| 国产成人99久久亚洲综合精品| 91丨porny丨中文| 欧美大片在线观看一区二区| 欧美影院午夜播放| 欧美一卡在线观看| 18欧美亚洲精品| 国产乱码精品一区二区三区忘忧草 | 色综合亚洲欧洲| 日韩视频123| 综合av第一页| 国产精品一区二区你懂的| 91免费精品国自产拍在线不卡 | 亚洲视频资源在线| 久久99精品久久久久久| 欧美老肥妇做.爰bbww视频| 国产精品国产三级国产| 经典三级在线一区| 在线播放91灌醉迷j高跟美女| 国产精品国产三级国产aⅴ原创| 午夜精品久久久久久久久久久| 97精品电影院| 国产日韩欧美a| 国产久卡久卡久卡久卡视频精品| 欧美精品丝袜久久久中文字幕| 亚洲天堂久久久久久久| 粉嫩aⅴ一区二区三区四区| 久久精品视频一区二区| 老司机免费视频一区二区| 在线播放日韩导航| 美国一区二区三区在线播放| 欧美一区二区成人6969| 欧美三级中文字| 国产欧美日韩视频一区二区| 国产一区视频导航| 国产日韩av一区二区| 国产精品一区免费视频| 国产精品大尺度| 91精品办公室少妇高潮对白| 一区二区三区四区高清精品免费观看| 97精品视频在线观看自产线路二| 国产精品国产三级国产专播品爱网 | 国产大陆亚洲精品国产| 中文字幕亚洲电影| 欧美日韩成人在线| 高清免费成人av| 亚洲高清在线精品| 国产亚洲综合在线| 欧美三电影在线| 成人免费视频播放| 日韩精品一二区| 成人免费在线视频观看| 欧美一级夜夜爽| 91国偷自产一区二区三区观看| 青娱乐精品视频| 一区二区三区加勒比av| 久久免费午夜影院| 欧美精品在线一区二区三区| 成人动漫精品一区二区| 玖玖九九国产精品| 亚洲444eee在线观看| 亚洲精品国产精品乱码不99 | 久久精品国产免费看久久精品| 国产欧美一区在线| 精品区一区二区| 日韩午夜av电影| 日韩一区二区在线播放| 精品视频在线视频| 欧美综合亚洲图片综合区| 福利一区福利二区| 成人午夜av在线| 国产麻豆精品在线| 国产成人aaaa| 99在线精品一区二区三区| 成人亚洲一区二区一| 国产精品影视网| 99riav久久精品riav| 91看片淫黄大片一级在线观看| 国产经典欧美精品| 99久久婷婷国产| 日本精品一级二级| 欧美日韩精品一区二区三区蜜桃 | 精品在线亚洲视频| 免费久久99精品国产| 日韩国产精品久久久| 蜜桃视频在线观看一区| 精品无码三级在线观看视频| 国产一区二区三区美女| 成人开心网精品视频| 色偷偷久久人人79超碰人人澡| 色88888久久久久久影院按摩 | 亚洲综合男人的天堂| 99久久国产综合精品女不卡| 91丨九色丨尤物| 久久久亚洲综合| 五月婷婷欧美视频| 成人免费视频一区二区| 日韩一级高清毛片|