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

📄 xsdl.java

📁 在线的java web 做的 学生选课系统。自己做的。大家可以一起讨论。
💻 JAVA
字号:
package gui;import javax.swing.JLabel;import com.cloudgarden.layout.AnchorLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JOptionPane;import javax.swing.JTextField;import com.cloudgarden.layout.AnchorConstraint;import edu.sist200.model.Student;import edu.sist200.services.BussinessServices;import java.awt.BorderLayout;import javax.swing.WindowConstants;/*** This code was generated using CloudGarden's Jigloo* SWT/Swing GUI Builder, which is free for non-commercial* use. If Jigloo is being used commercially (ie, by a corporation,* company or business for any purpose whatever) then you* should purchase a license for each developer using Jigloo.* Please visit www.cloudgarden.com for details.* Use of Jigloo implies acceptance of these licensing terms.* ************************************** A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED* for this machine, so Jigloo or this code cannot be used legally* for any corporate or commercial purpose.* **************************************/public class XSDL extends javax.swing.JFrame {	private JLabel jLabel1;	private JLabel jLabel2;	private JTextField xh;	private JButton jButton2;	private JButton jButton1;	private JTextField jTextField1;	private JLabel jLabel3;	static XSDL inst;	/**	* Auto-generated main method to display this JFrame	*/	public static void main(String[] args) {		inst= new XSDL();		inst.setVisible(true);	}	public void setInst(XSDL inst){		this.inst=inst;		inst.setLocation((1024-400)/2, (768-300)/2);	}	public XSDL() {		super();		initGUI();	}		private void initGUI() {		try {			AnchorLayout thisLayout = new AnchorLayout();			this.getContentPane().setLayout(thisLayout);			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);			{				jButton2 = new JButton();				this.getContentPane().add(					jButton2,					new AnchorConstraint(						704,						715,						817,						562,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL));				jButton2.setText("\u8fd4\u56de");				jButton2.setPreferredSize(new java.awt.Dimension(60, 30));				jButton2.addActionListener(new ActionListener() {					public void actionPerformed(ActionEvent evt) {												XsJFrame m=new XsJFrame();												m.setVisible(true);						m.setInst(m);						inst.setVisible(false);					}				});			}			{				jButton1 = new JButton();				this.getContentPane().add(					jButton1,					new AnchorConstraint(						704,						327,						817,						174,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL));				jButton1.setText("\u786e\u5b9a");				jButton1.setPreferredSize(new java.awt.Dimension(60, 30));				jButton1.addActionListener(new ActionListener() {					public void actionPerformed(ActionEvent evt) {												String xh1=xh.getText();						String mm=jTextField1.getText();						Student s=new Student();						s.setSno(xh1);						s.setPassword(mm);						BussinessServices bs=new BussinessServices();						boolean f=bs.stulogin(s);						if(f)						{							JOptionPane.showMessageDialog(null, "登陆成功!您可以操作了!");							DLCG xs=new DLCG(s);							xs.setInst(xs);							xs.setVisible(true);							inst.setVisible(false);						}						else							{								JOptionPane.showMessageDialog(null, "用户名和密码错误,请重新输入:");								xh.setText("");								jTextField1.setText("");							}					}				});			}			{				jTextField1 = new JTextField();				this.getContentPane().add(					jTextField1,					new AnchorConstraint(						486,						753,						599,						452,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL));				jTextField1.setPreferredSize(new java.awt.Dimension(118, 30));			}			{				jLabel3 = new JLabel();				this.getContentPane().add(					jLabel3,					new AnchorConstraint(						483,						399,						595,						246,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL));				jLabel3.setText("\u5bc6\u7801\uff1a");				jLabel3.setPreferredSize(new java.awt.Dimension(60, 30));			}			{				xh = new JTextField();				this.getContentPane().add(					xh,					new AnchorConstraint(						283,						756,						396,						445,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL));				xh.setPreferredSize(new java.awt.Dimension(122, 30));			}			{				jLabel2 = new JLabel();				this.getContentPane().add(					jLabel2,					new AnchorConstraint(						295,						399,						407,						246,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL));				jLabel2.setText("\u5b66\u53f7\uff1a");				jLabel2.setPreferredSize(new java.awt.Dimension(60, 30));			}			{				jLabel1 = new JLabel();				this.getContentPane().add(					jLabel1,					new AnchorConstraint(						80,						623,						231,						340,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL,						AnchorConstraint.ANCHOR_REL));				jLabel1.setText("\u5b66\u751f\u767b\u9646");				jLabel1.setPreferredSize(new java.awt.Dimension(111, 40));				jLabel1.setFont(new java.awt.Font("Dialog",1,22));			}			pack();			setSize(400, 300);		} catch (Exception e) {			e.printStackTrace();		}	}		/**	* Auto-generated method for setting the popup menu for a component	*/	private void setComponentPopupMenu(final java.awt.Component parent, final javax.swing.JPopupMenu menu) {parent.addMouseListener(new java.awt.event.MouseAdapter() {public void mousePressed(java.awt.event.MouseEvent e) {if(e.isPopupTrigger())menu.show(parent, e.getX(), e.getY());}public void mouseReleased(java.awt.event.MouseEvent e) {if(e.isPopupTrigger())menu.show(parent, e.getX(), e.getY());}});	}}

⌨️ 快捷键说明

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