searstuinfobystuname.java

来自「在本系统中」· Java 代码 · 共 82 行

JAVA
82
字号


//可以按照学生学号、学生姓名、班级名称、专业名称和院系名称分别查询满足条件的学生信息,
//也可以查询所有学生信息。显示的学生信息包括:学生学号、学生姓名、班级名称、专业名称、院系名称五个数据项

//按照学生姓名查询

package jin.internalFrame;

import java.awt.*;
import javax.swing.*;


import jin.handler.*;
import jin.view.ButtonsPanel;
 
//按课程编号查询
public class SearStuInfoByStuName extends JInternalFrame 
{
	private JLabel label;
	private JTextField field;
	
	private JPanel panel;
	private ButtonsPanel buttonsPanel;	
	
	private JDesktopPane desktopPane;
	private JFrame frame;
	//private String id;
	
	public SearStuInfoByStuName(JFrame frame,JDesktopPane desktopPane)  //,String id
	{
		super("",true,true,true,true);
		this.frame=frame;
		this.desktopPane=desktopPane;
		//this.id=id;
		
		label=new JLabel("输入学生姓名");
		field=new JTextField(6);
		field.grabFocus();
		buttonsPanel=new ButtonsPanel(2);
		
		String str[]={"确定","取消"
		};
		
		buttonsPanel.setTitles(str);	
		panel=new JPanel();
		panel.add(label);
		panel.add(field);
		panel.add(buttonsPanel);	
		
		setLayout(new BorderLayout());
		add(panel,BorderLayout.NORTH);
		
		desktopPane.add(this);
		frame.add(desktopPane);	
		
		SearStuInfoByStuNameHandler handler=new SearStuInfoByStuNameHandler(this);
		
		this.setSize(450,450);
		this.setVisible(true);
	}
	
	
	public JTextField getField()
	{
		return field;
	}
	public ButtonsPanel getButtonsPanel()
	{
		return buttonsPanel;
	}
	
	public static void main(String args[])
	{
		JFrame frame=new JFrame();
	    JDesktopPane desktopPane=new JDesktopPane();
	    SearStuInfoByStuName app=new SearStuInfoByStuName(frame,desktopPane);
	    
	    frame.setSize(500,500);
	    frame.setVisible(true);	    
	}
}

⌨️ 快捷键说明

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