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

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

?? jfrmfacultybook.java

?? Hi, this program is for my Java assignment.. this is a simple program which make use of JTable, MDI,
?? JAVA
字號:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.border.TitledBorder;

public class jfrmFacultyBook extends JInternalFrame implements ItemListener {
//-------------------------------------------- Faculty Book Constructor
	public jfrmFacultyBook(String strTitle, clsBookListEntry[] arrFIn,
								  clsBookListEntry[] arrBIn,clsBookListEntry[] arrCIn) {
		//<!-- INIT_CONTROLS
		// super(title, resizable, closable, maximizable, iconifiable)
		super(strTitle, false, true, false, true);
		getContentPane().setLayout(null);
		setLocation(55, 52);
		setSize(480,315);
		setVisible(false);

		TitledBorder tbdrCourse = new TitledBorder(" Course Details ");
		tbdrCourse.setTitleColor(Color.black);
		jpnlCourseDtl.setBorder(tbdrCourse);
		jpnlCourseDtl.setBackground(Color.white);
		jpnlCourseDtl.setBounds(0,0,470,90);
		jpnlCourseDtl.setLayout(null);

		jlblCourseNo.setFont(new Font("Dialog", Font.PLAIN, 12));
		jlblCourseNo.setForeground(Color.black);
		jlblCourseNo.setText("Course Number:");
		jlblCourseNo.setBounds(12,20,100,20);
		jpnlCourseDtl.add(jlblCourseNo);

		jcboCourseNo.setFont(new Font("Dialog", Font.PLAIN, 12));
		jcboCourseNo.setToolTipText("Choose a Course Number from the list");
		jcboCourseNo.setBackground(Color.white);
		jcboCourseNo.setBounds(108,20,110,24);
		jpnlCourseDtl.add(jcboCourseNo);

		jlblCourseName.setFont(new Font("Dialog", Font.PLAIN, 12));
		jlblCourseName.setForeground(Color.black);
		jlblCourseName.setText("Course Name:");
		jlblCourseName.setBounds(12,50,90,20);
		jpnlCourseDtl.add(jlblCourseName);

		jtxtCourseName.setBounds(108,50,350,24);
		jtxtCourseName.setEnabled(false);
		jpnlCourseDtl.add(jtxtCourseName);

		getContentPane().add(jpnlCourseDtl);

		TitledBorder tbdrBook = new TitledBorder(" Text Book Details ");
		tbdrBook.setTitleColor(Color.black);
		jpnlBookDtl.setBorder(tbdrBook);
		jpnlBookDtl.setBackground(Color.white);
		jpnlBookDtl.setBounds(0,90,470,190);
		jpnlBookDtl.setLayout(null);

		jlblBookNo.setFont(new Font("Dialog", Font.PLAIN, 12));
		jlblBookNo.setForeground(Color.black);
		jlblBookNo.setBounds(12,20,90,20);
		jlblBookNo.setText("Book Number:");
		jpnlBookDtl.add(jlblBookNo);

		jcboBookNo.setFont(new Font("Dialog", Font.PLAIN, 12));
		jcboBookNo.setToolTipText("Choose a Book Number from the list");
		jcboBookNo.setBackground(Color.white);
		jcboBookNo.setBounds(108,20,110,24);
		jpnlBookDtl.add(jcboBookNo);

		jlblBookName.setFont(new Font("Dialog", Font.PLAIN, 12));
		jlblBookName.setForeground(Color.black);
		jlblBookName.setBounds(12,50,90,20);
		jlblBookName.setText("Book Name:");
		jpnlBookDtl.add(jlblBookName);

		jtxtBookName.setBounds(108,50,350,24);
		jtxtBookName.setEnabled(false);
		jpnlBookDtl.add(jtxtBookName);

		jlblPublisher.setFont(new Font("Dialog", Font.PLAIN, 12));
		jlblPublisher.setForeground(Color.black);
		jlblPublisher.setBounds(12,80,90,20);
		jlblPublisher.setText("Publisher:");
		jpnlBookDtl.add(jlblPublisher);

		jtxtPublisher.setBounds(108,80,350,24);
		jtxtPublisher.setEnabled(false);
		jpnlBookDtl.add(jtxtPublisher);

		jlblEdition.setFont(new Font("Dialog", Font.PLAIN, 12));
		jlblEdition.setForeground(Color.black);
		jlblEdition.setBounds(12,110,90,20);
		jlblEdition.setText("Edition:");
		jpnlBookDtl.add(jlblEdition);

		jtxtEdition.setBounds(108,110,110,24);
		jtxtEdition.setEnabled(false);
		jpnlBookDtl.add(jtxtEdition);

		jlblYear.setFont(new Font("Dialog", Font.PLAIN, 12));
		jlblYear.setForeground(Color.black);
		jlblYear.setBounds(235,110,110,20);
		jlblYear.setText("Year of Publication:");
		jpnlBookDtl.add(jlblYear);

		jtxtYear.setBounds(349,110,110,24);
		jtxtYear.setEnabled(false);
		jpnlBookDtl.add(jtxtYear);

		jlblPrice.setFont(new Font("Dialog", Font.PLAIN, 12));
		jlblPrice.setForeground(Color.black);
		jlblPrice.setBounds(12,140,90,20);
		jlblPrice.setText("Retail Price:");
		jpnlBookDtl.add(jlblPrice);

		jtxtPrice.setBounds(108,140,110,24);
		jtxtPrice.setEnabled(false);
		jpnlBookDtl.add(jtxtPrice);

		jlblType.setFont(new Font("Dialog", Font.PLAIN, 12));
		jlblType.setForeground(Color.black);
		jlblType.setBounds(235,140,90,20);
		jlblType.setText("Type:");
		jpnlBookDtl.add(jlblType);

		jtxtType.setBounds(349,140,110,24);
		jtxtType.setEnabled(false);
		jpnlBookDtl.add(jtxtType);

		jlblDesc.setText("R = Recommended Reading; P = Prescribed");
		jlblDesc.setFont(new Font("Dialog", Font.PLAIN, 10));
		jlblDesc.setForeground(Color.black);
		jlblDesc.setBounds(250,160,210,20);
		jpnlBookDtl.add(jlblDesc);
		getContentPane().add(jpnlBookDtl);

		arrFaculty   = arrFIn;
		arrBook      = arrBIn;
		arrCourse    = arrCIn;
		intIndex     = 0;
		intLastIndex = 0;
		intCPos 		 = objFileHdl.mtd_getLastIndex(arrCourse);
		intBPos 		 = objFileHdl.mtd_getLastIndex(arrBook);
		mtd_fillJCbo();
		// Make sure the array is not null
		if(arrFaculty != null) {
			if(arrFaculty[intIndex] != null) {
				// Get array last index
				intLastIndex = objFileHdl.mtd_getLastIndex(arrFaculty);
				// Assign 1st element into JTextField
				mtd_Search(intIndex);
			}
		}
		//<!-- REGISTER_LISTENERS
		jcboCourseNo.addItemListener(this);
		jcboBookNo.addItemListener(this);
		//-->
	}

//-------------------------------------------- Faculty Book Listener
	public void itemStateChanged(ItemEvent event) {
		if (event.getStateChange() == 1) {
			if(event.getSource() == jcboCourseNo) {
				intCPos = jcboCourseNo.getSelectedIndex() - 1;
				mtd_fillCourseDtl(intCPos);
				if(!bIsInsert) jcboBookNo.showPopup();
			} else if(event.getSource() == jcboBookNo) {
				intBPos = jcboBookNo.getSelectedIndex() - 1;
				mtd_fillBookDtl(intBPos);
			}
		}
	}

//-------------------------------------------- Faculty Book New Record method
	public void mtd_New() {
		// Make sure the size doesn't over exceed the array
		if(arrFaculty != null) {
			if(intLastIndex >= arrBook.length) {
				String strErrMsg = "The program only allow you to insert 100 records " +
										 "for each run.\nYou have exceeded that amount, " +
										 "please save your work and\nre-run the program again.";
				objFileHdl.mtd_MsgBox(" - Faculty Books Details",strErrMsg,-1,0);
				return;
			}
		}
		jcboCourseNo.setSelectedIndex(0);
		jcboBookNo.setSelectedIndex(0);
		mtd_fillBookDtl(-1);
		mtd_fillCourseDtl(-1);
		jcboCourseNo.showPopup();
		bIsInsert = false;
	}

//-------------------------------------------- Faculty Book Save Record method
	public void mtd_Save() {
		if(mtd_Validate()) {
			String strCourseNo = jcboCourseNo.getSelectedItem().toString();
			String strBookNo   = jcboBookNo.getSelectedItem().toString();
			if(!bIsInsert) {		// In inserting mode
				if(intLastIndex == 0) {
					// If the array is empty, create a new array with 100 elements
					arrFaculty = new clsBookListEntry[100];
				} else {
					// Make sure the record is unique
					for(int f=0; f < intLastIndex; f++) {
						if(arrFaculty[f].getCourseNo().equalsIgnoreCase(strCourseNo) &&
							arrFaculty[f].getBookNo().equalsIgnoreCase(strBookNo)) {
							String strMsg = "The record you have enter is already " +
												 "exists.\nDo you want to edit its details?";
							if(objFileHdl.mtd_MsgBox(" - Faculty Books Details", strMsg, 0, 2)
								== 0) {
								mtd_Search(f);
								bIsInsert = true;
							}
							jcboCourseNo.showPopup();
							return;
						}
					}
				}
				arrFaculty[intLastIndex] = new clsBookListEntry();
				arrFaculty[intLastIndex].setCourseNo(strCourseNo);
				arrFaculty[intLastIndex].setBookNo(strBookNo);
				intIndex = intLastIndex;
				// Update array last index
				intLastIndex++;
			} else {					// In updating mode
				if(intLastIndex == 0) {
					String strMsg = "You cannot edit this record because the file is empty.\n"
										 + "Please create new record first.";
					objFileHdl.mtd_MsgBox(" - Faculty Books Details",strMsg,-1,0);
					return;
				}
				arrFaculty[intIndex].setCourseNo(strCourseNo);
				arrFaculty[intIndex].setBookNo(strBookNo);
			}
			bIsInsert = true;
			objFileHdl.mtd_MsgBox(" - Faculty Books Details", "Record saved successfully.",-1,1);
		}
	}

//-------------------------------------------- Faculty Book Delete Record method
	public void mtd_Delete() {
		// Array is empty, prompt msg
		if(arrFaculty == null || arrFaculty[0] == null) {
			objFileHdl.mtd_MsgBox(" - Faculty Books Details",
										 "There is no record in the file " +
										 "to delete.", -1, 0);
			return;
		}
		if(bIsInsert) {			// In updating mode, can delete
			int intChoice;
			intChoice = objFileHdl.mtd_MsgBox(" - Faculty Books Details",
														 "Are you sure you want " +
														 "to delete this record?", 0, 3);
			if(intChoice == 0) {
				if(objFileHdl.mtd_Delete(arrFaculty, intIndex)) {
					objFileHdl.mtd_MsgBox(" - Faculty Books Details",
												 "Record has been deleted.",-1,1);
					--intLastIndex;
					if(intLastIndex <=0) {
						objFileHdl.mtd_MsgBox(" - Faculty Books Details",
													 "There is no more record " +
													 "in the file.\nClick OK to create a new record.",
													 -1, 1);
						mtd_New();
					} else if(intIndex == 0) {
						mtd_Navigation(0);
					} else {
						mtd_Navigation(-1);
					}
				}
			}
		} else {						// In inserting mode, cannot delete
			objFileHdl.mtd_MsgBox(" - Faculty Books Details",
										 "You cannot delete record while you " +
										 "are in inserting mode.", -1, 2);
		}
	}

//-------------------------------------------- Faculty Book Search method
	public void mtd_Search(int intPosition) {
		if(intPosition != -1) {
			intCPos = objFileHdl.mtd_SearchCourse(arrCourse,
															  arrFaculty[intPosition].getCourseNo(), 0);
			intBPos = objFileHdl.mtd_SearchBook(arrBook,
															arrFaculty[intPosition].getBookNo(), 0);
			jcboCourseNo.setSelectedIndex(intCPos + 1);
			jcboBookNo.setSelectedIndex(intBPos + 1);
			mtd_fillCourseDtl(intCPos);
			mtd_fillBookDtl(intBPos);
			intIndex = intPosition;
		}
	}

//-------------------------------------------- Faculty Book back/next method
	public void mtd_Navigation(int intDirection) {
		intIndex  += intDirection;
		bIsInsert = true;
		// Array is empty, prompt msg
		if(arrFaculty == null) {
			objFileHdl.mtd_MsgBox(" - Faculty Books Details",
										 "There is no record in the file, " +
										 "please insert record first.",-1,0);
			return;
		}
		if(intIndex >= 0) {
			if(intIndex < intLastIndex) {
				intCPos = objFileHdl.mtd_SearchCourse(arrCourse,
																  arrFaculty[intIndex].getCourseNo(), 0);
				intBPos = objFileHdl.mtd_SearchBook(arrBook,
																arrFaculty[intIndex].getBookNo(), 0);
				jcboCourseNo.setSelectedIndex(intCPos + 1);
				jcboBookNo.setSelectedIndex(intBPos + 1);
			} else {
				objFileHdl.mtd_MsgBox(" - Faculty Books Details","End of file reached!\n" +
											 "You can't go to the specified record.",-1,2);
				intIndex -= intDirection;	// Undo the addition (frm above)
			}
		} else {
			objFileHdl.mtd_MsgBox(" - Faculty Books Details","Start of file reached!\n" +
										 "You can't go to the specified record.",-1,2);
			intIndex = 0;						// Point to the 1st element
		}
	}

//--------------------------------------- Initialize value into all JTextField/JCombo
	private void mtd_fillJCbo() {
		jcboCourseNo.addItem("[Choose One]");
		for(int c=0; c < intCPos; c++)
			jcboCourseNo.addItem(arrCourse[c].getCourseNo());
		jcboBookNo.addItem("[Choose One]");
		for(int b=0; b < intBPos; b++)
			jcboBookNo.addItem(arrBook[b].getBookNo());
	}

	private void mtd_fillCourseDtl(int i) {
		if(i != -1) {
			// Take Course array value assign into JTextField
			jtxtCourseName.setText(arrCourse[i].getCourseName());
		} else {
			// Clear JTextField value
			jtxtCourseName.setText("");
		}
	}

	private void mtd_fillBookDtl(int i) {
		if(i != -1) {
			// Take Book array value assign into JTextField
			jtxtBookName.setText(arrBook[i].getBookName());
			jtxtPublisher.setText(arrBook[i].getPublisher());
			jtxtYear.setText(objFileHdl.mtd_formatValue(arrBook[i].getYear(), "####"));
			jtxtPrice.setText(objFileHdl.mtd_formatValue(arrBook[i].getPrice(),
																		"#,###.00"));
			jtxtEdition.setText(objFileHdl.mtd_formatValue(arrBook[i].getEdition(),
																		  "###"));
			jtxtType.setText(String.valueOf(arrBook[i].getType()));
		} else {
			// Clear JTextField value
			jtxtBookName.setText("");
			jtxtPublisher.setText("");
			jtxtYear.setText("");
			jtxtPrice.setText("");
			jtxtEdition.setText("");
			jtxtType.setText("");
		}
	}

//-------------------------------------------- Faculty Book Validate Record method
	private boolean mtd_Validate() {
		boolean bRet     = true;
		String strErrMsg = "";
		if(jcboCourseNo.getSelectedIndex() == 0) {
			strErrMsg = "Please choose a Course Number from the list.";
			jcboCourseNo.showPopup();
			bRet 		 = false;
		} else if(jcboBookNo.getSelectedIndex() == 0) {
			strErrMsg = "Please choose a Book Number from the list.";
			jcboBookNo.showPopup();
			bRet 		 = false;
		}
		if(!bRet) objFileHdl.mtd_MsgBox(" - Faculty Books Details",strErrMsg,-1,0);
		return bRet;
	}

	// Return the latest array back to parent frame
	public clsBookListEntry[] mtd_getarrFacultyBook() { return arrFaculty; }
	//<!-- DECLARE_CONTROLS/VARIABLES
	private int intIndex, intLastIndex, intBPos, intCPos;
	private clsBookListEntry[] arrFaculty, arrBook, arrCourse;
	private clsFileHdl objFileHdl     = new clsFileHdl();
	private boolean bIsInsert			 = true;
	private JPanel jpnlCourseDtl      = new JPanel();
	private JPanel jpnlBookDtl 		 = new JPanel();
	private JComboBox jcboCourseNo    = new JComboBox();
	private JComboBox jcboBookNo		 = new JComboBox();
	private JTextField jtxtCourseName = new JTextField();
	private JTextField jtxtBookName   = new JTextField();
	private JTextField jtxtPublisher  = new JTextField();
	private JTextField jtxtEdition    = new JTextField();
	private JTextField jtxtYear       = new JTextField();
	private JTextField jtxtPrice		 = new JTextField();
	private JTextField jtxtType 		 = new JTextField();
	private JLabel jlblCourseNo 		 = new JLabel();
	private JLabel jlblCourseName	    = new JLabel();
	private JLabel jlblBookNo 		    = new JLabel();
	private JLabel jlblBookName 	    = new JLabel();
	private JLabel jlblPublisher      = new JLabel();
	private JLabel jlblEdition        = new JLabel();
	private JLabel jlblYear           = new JLabel();
	private JLabel jlblPrice          = new JLabel();
	private JLabel jlblType           = new JLabel();
	private JLabel jlblDesc 			 = new JLabel();
	//-->
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美日韩一区二区| 欧美一区二视频| 欧美午夜精品一区二区三区| 欧美一区二区黄色| 亚洲人成网站影音先锋播放| 美国精品在线观看| 在线观看精品一区| 亚洲欧洲精品天堂一级| 久草热8精品视频在线观看| 欧洲一区在线观看| 国产欧美一区二区精品秋霞影院 | 91亚洲精品久久久蜜桃网站| 欧美一区二区网站| 亚洲综合在线观看视频| 国产成人精品免费网站| 欧美r级在线观看| 日韩在线卡一卡二| 欧美日高清视频| 亚洲精品成人悠悠色影视| 粉嫩av一区二区三区在线播放| 欧美一二三四区在线| 午夜久久久久久久久 | 国产不卡视频一区二区三区| 91精品国产全国免费观看| 亚洲影院久久精品| 91美女在线观看| 亚洲国产高清aⅴ视频| 国产在线精品一区二区三区不卡| 日韩午夜小视频| 丝袜国产日韩另类美女| 欧美天天综合网| 亚洲成av人**亚洲成av**| 91亚洲精品久久久蜜桃网站| 综合激情网...| 一本一道久久a久久精品| 亚洲日本在线天堂| 在线中文字幕一区| 亚洲国产视频一区二区| 欧美三级日本三级少妇99| 亚洲国产中文字幕| 欧美一区二区高清| 国产在线看一区| 欧美国产日韩在线观看| 成人av网址在线观看| 中文字幕制服丝袜一区二区三区 | 日韩av午夜在线观看| 91精品国产福利| 麻豆国产精品官网| 欧美韩国日本不卡| 色伊人久久综合中文字幕| 一区二区高清免费观看影视大全 | 久久精品一区二区三区四区| 国产精品一二三四区| 国产精品福利影院| 久久久久久免费毛片精品| a级高清视频欧美日韩| 亚洲精品高清在线观看| 欧美肥妇bbw| 国产成人丝袜美腿| 一区二区三区精品视频在线| 欧美久久久久久蜜桃| 国产一区二区精品久久91| 亚洲欧洲成人自拍| 欧美一区二区三区免费大片| 国产成人精品影院| 亚洲国产综合色| 国产午夜亚洲精品不卡| 91蜜桃免费观看视频| 老司机精品视频线观看86| 国产欧美一二三区| 91精品国产美女浴室洗澡无遮挡| 国产激情视频一区二区三区欧美| 亚洲免费观看在线视频| 精品久久久久久久人人人人传媒 | 亚洲视频中文字幕| 欧美一区三区二区| 成人高清免费观看| 美腿丝袜在线亚洲一区| 国产精品美女久久久久久| 在线不卡a资源高清| av亚洲精华国产精华精| 免费在线一区观看| 亚洲一区二区三区自拍| 久久久亚洲精华液精华液精华液| 蜜臀av性久久久久蜜臀aⅴ| 亚洲精品写真福利| 国产日产欧美一区| 欧美一区三区二区| 欧美综合亚洲图片综合区| 国产传媒欧美日韩成人| 男男成人高潮片免费网站| 亚洲精品乱码久久久久久久久 | 欧美成人艳星乳罩| 欧美午夜精品一区二区蜜桃| 不卡一卡二卡三乱码免费网站| 丝袜美腿亚洲一区二区图片| 亚洲色欲色欲www在线观看| 久久夜色精品国产噜噜av| 欧美日韩大陆在线| 欧美天堂一区二区三区| 一本色道久久综合亚洲aⅴ蜜桃| 精品一区精品二区高清| 免费欧美日韩国产三级电影| 樱桃视频在线观看一区| 亚洲视频在线观看三级| 欧美激情艳妇裸体舞| 久久精品亚洲乱码伦伦中文| 日韩欧美卡一卡二| 日韩欧美国产一二三区| 欧美一级日韩免费不卡| 欧美精品电影在线播放| 欧美疯狂性受xxxxx喷水图片| 欧美日韩一区二区三区免费看| 97精品视频在线观看自产线路二| 风间由美一区二区三区在线观看| 久久99久久99| 看电影不卡的网站| 日本欧美肥老太交大片| 日本一区中文字幕| 麻豆免费精品视频| 国内精品久久久久影院色| 国产一区不卡精品| 国产丶欧美丶日本不卡视频| 在线亚洲+欧美+日本专区| 精品一区二区在线观看| 午夜精品在线视频一区| 亚洲自拍偷拍麻豆| 日韩福利电影在线观看| 麻豆精品一区二区| 激情五月婷婷综合网| 国产精品1024久久| av男人天堂一区| 亚洲aⅴ怡春院| 成人午夜视频福利| 日韩欧美一区在线观看| 一区二区三区在线视频观看58| 精品一区在线看| 欧美人妇做爰xxxⅹ性高电影| 国产拍欧美日韩视频二区| 午夜久久久久久久久| 91一区在线观看| 国产亚洲精品资源在线26u| 日韩国产精品久久久久久亚洲| 99精品久久只有精品| 久久精品一区四区| 麻豆成人av在线| 3d动漫精品啪啪| 亚洲电影激情视频网站| 一本久久a久久精品亚洲| 欧美高清在线视频| 国产乱人伦精品一区二区在线观看| 欧美日本在线播放| 亚洲美女在线国产| 精品一区在线看| 日韩精品一区二区三区老鸭窝| 亚洲欧洲日韩综合一区二区| 狠狠色狠狠色综合| 欧美videossexotv100| 91精品欧美综合在线观看最新| 老鸭窝一区二区久久精品| 亚洲欧美区自拍先锋| 日韩美女视频一区二区在线观看| 国产成人综合视频| 亚洲另类一区二区| 国产网站一区二区| 成人免费视频视频在线观看免费| 视频一区二区三区中文字幕| 亚洲欧美日韩国产手机在线 | 日韩精品一区二区三区中文不卡 | 国产精品福利一区| 色悠悠久久综合| 五月天婷婷综合| 欧美一级久久久| 欧美日韩一区二区三区高清| 久久99精品一区二区三区| 久久久电影一区二区三区| 欧美视频日韩视频在线观看| 国产精华液一区二区三区| 久久国产夜色精品鲁鲁99| 亚洲国产欧美一区二区三区丁香婷| 成人h动漫精品| 91在线一区二区三区| 成人福利在线看| 成人理论电影网| 免费一区二区视频| 亚洲成人自拍偷拍| 一区在线播放视频| 欧美成人a∨高清免费观看| 欧美日韩三级一区二区| 日韩一区二区三区高清免费看看| 色久综合一二码| 欧美图片一区二区三区| 精品国产乱码久久久久久久| 国产精品情趣视频| 五月天亚洲精品| 成人爱爱电影网址| 日韩欧美国产不卡| 亚洲视频网在线直播| 国产真实乱子伦精品视频| 91福利小视频|