⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 querystudinfopanel.java

📁 您的文件包然后写出其具体功能(至少要20个字)。尽量不要让站长把时间都花费在为您
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
			}
		});
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 3;
		gridBagConstraints.gridy = 1;
		gridBagConstraints.weightx = 5.0;
		gridBagConstraints.weighty = 0.1;
		add(query, gridBagConstraints);

		age.setColumns(20);
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 3;
		gridBagConstraints.gridy = 4;
		gridBagConstraints.weightx = 5.0;
		gridBagConstraints.weighty = 0.1;
		add(age, gridBagConstraints);

		studentid.setColumns(20);
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 1;
		gridBagConstraints.gridy = 3;
		gridBagConstraints.weightx = 5.0;
		gridBagConstraints.weighty = 0.1;
		add(studentid, gridBagConstraints);

		year.setColumns(20);
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 1;
		gridBagConstraints.gridy = 6;
		gridBagConstraints.weightx = 5.0;
		gridBagConstraints.weighty = 0.1;
		add(year, gridBagConstraints);

		java.util.List<ClassInfo> list=null;
		ClassDao classdao=new ClassDao();
		list=classdao.getAllClass();
		Iterator<ClassInfo> iter=list.iterator();
		while(iter.hasNext())
			classid.addItem(iter.next().getClassID());
		classid.setPreferredSize(new java.awt.Dimension(130, 23));
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 1;
		gridBagConstraints.gridy = 5;
		gridBagConstraints.weightx = 5.0;
		gridBagConstraints.weighty = 0.1;
		add(classid, gridBagConstraints);

		sex.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "男",
		"女" }));
		
		sex.setPreferredSize(new java.awt.Dimension(130, 23));
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 1;
		gridBagConstraints.gridy = 4;
		gridBagConstraints.weightx = 5.0;
		gridBagConstraints.weighty = 0.1;
		add(sex, gridBagConstraints);

		jLabel15.setBorder(javax.swing.BorderFactory
				.createLineBorder(new java.awt.Color(0, 0, 0)));
		jLabel15.setPreferredSize(new java.awt.Dimension(125, 140));
		jLabel15.setText("photo");
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 4;
		gridBagConstraints.gridy = 2;
		gridBagConstraints.gridwidth = 3;
		gridBagConstraints.gridheight = 3;
		gridBagConstraints.weightx = 5.0;
		add(jLabel15, gridBagConstraints);

		family.setColumns(20);
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 3;
		gridBagConstraints.gridy = 5;
		gridBagConstraints.weightx = 5.0;
		gridBagConstraints.weighty = 0.1;
		add(family, gridBagConstraints);

		day.setColumns(20);
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 5;
		gridBagConstraints.gridy = 6;
		gridBagConstraints.weightx = 5.0;
		gridBagConstraints.weighty = 0.1;
		add(day, gridBagConstraints);

		identification.setColumns(20);
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 1;
		gridBagConstraints.gridy = 7;
		gridBagConstraints.weightx = 5.0;
		gridBagConstraints.weighty = 0.1;
		add(identification, gridBagConstraints);

		month.setColumns(20);
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 3;
		gridBagConstraints.gridy = 6;
		gridBagConstraints.weightx = 5.0;
		gridBagConstraints.weighty = 0.1;
		add(month, gridBagConstraints);

		querystudentid.setColumns(20);
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 1;
		gridBagConstraints.gridy = 1;
		gridBagConstraints.weightx = 5.0;
		gridBagConstraints.weighty = 0.1;
		add(querystudentid, gridBagConstraints);

		jScrollPane1.setBorder(javax.swing.BorderFactory.createTitledBorder(
				null, "\u8bf4\u660e",
				javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
				javax.swing.border.TitledBorder.DEFAULT_POSITION,
				new java.awt.Font("宋体", 0, 12), new java.awt.Color(0, 0, 0)));
		jScrollPane1.setPreferredSize(new java.awt.Dimension(600, 120));

		jTextArea1.setColumns(20);
		jTextArea1.setRows(5);
		jScrollPane1.setViewportView(jTextArea1);

		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 0;
		gridBagConstraints.gridy = 9;
		gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
		gridBagConstraints.weightx = 5.0;
		gridBagConstraints.weighty = 0.1;
		add(jScrollPane1, gridBagConstraints);
		
		age.setEditable(false);//
		sex.setEnabled(false);//这是不启动选择项,
		//classid.setEditable(false);这是可选择的,但是不可以编辑里面的项目
		classid.setEnabled(false);
		studentid.setEditable(false);
		name.setEditable(false);
		family.setEditable(false);
		identification.setEditable(false);
		year.setEditable(false);
		month.setEditable(false);
		day.setEditable(false);
		begintime.setEditable(false);
		jTextArea1.setEditable(false);
	}
	
	private void queryActionPerformed(java.awt.event.ActionEvent evt) {
		StudentInfoDao studentinfodao=new StudentInfoDao();
		StudentInfo studentinfo=studentinfodao.getStudentInfo(querystudentid.getText().trim());
		studentid.setText(studentinfo.getStudentID());
		name.setText(studentinfo.getStudentName());
		age.setText(studentinfo.getAge());
		sex.setSelectedItem(studentinfo.getSex());
		classid.setSelectedItem(studentinfo.getClassID());
		family.setText(studentinfo.getFamily());
		identification.setText(studentinfo.getIdentification());
		String[] birth=studentinfo.getBirthday().split("-");
		year.setText(birth[0]);
		month.setText(birth[1]);
		day.setText(birth[2]);
		begintime.setText(studentinfo.getBeginTime());
		jTextArea1.setText(studentinfo.getRemarks());
		InputStream input=studentinfo.getOLEPhoto();
		byte[] by=null;
		if(input!=null){
			try{
				by=new byte[input.available()];
				ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
			    int ch;
			    while ((ch = input.read()) !=-1)
			       bytestream.write(ch);
			    by=bytestream.toByteArray();
			}catch(IOException e){
				e.printStackTrace();
			}
		}
		if(by!=null){
			ImageIcon image=new ImageIcon(by);
			image.setImage(image.getImage().getScaledInstance(150, 200,Image.SCALE_DEFAULT));
			jLabel15.setIcon(image);
			jLabel15.setText("");
		}
	}
	private javax.swing.JTextField age;
	private javax.swing.JTextField begintime;
	private javax.swing.JComboBox classid;
	private javax.swing.JTextField day;
	private javax.swing.JTextField family;
	private javax.swing.JTextField identification;
	private javax.swing.JButton jButton1;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JLabel jLabel10;
	private javax.swing.JLabel jLabel11;
	private javax.swing.JLabel jLabel12;
	private javax.swing.JLabel jLabel13;
	private javax.swing.JLabel jLabel14;
	private javax.swing.JLabel jLabel15;
	private javax.swing.JLabel jLabel2;
	private javax.swing.JLabel jLabel3;
	private javax.swing.JLabel jLabel4;
	private javax.swing.JLabel jLabel5;
	private javax.swing.JLabel jLabel6;
	private javax.swing.JLabel jLabel7;
	private javax.swing.JLabel jLabel8;
	private javax.swing.JLabel jLabel9;
	private javax.swing.JScrollPane jScrollPane1;
	private javax.swing.JTextArea jTextArea1;
	private javax.swing.JTextField month;
	private javax.swing.JTextField name;
	private javax.swing.JButton query;
	private javax.swing.JTextField querystudentid;
	private javax.swing.JComboBox sex;
	private javax.swing.JTextField studentid;
	private javax.swing.JTextField year;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -