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

📄 spesubupdateframe.java

📁 包含了学生管理系统的一些基本操作以及相关窗口页面实现。
💻 JAVA
字号:
package com.hb.studentmanager.ui;import java.awt.Toolkit;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.ComboBoxModel;import javax.swing.DefaultComboBoxModel;import javax.swing.JButton;import javax.swing.JComboBox;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JTable;import javax.swing.WindowConstants;import com.hb.studentmanager.action.SpeSubAction;/*** This code was edited or 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 SpeSubUpdateFrame extends javax.swing.JDialog {	private JPanel panel;	private JLabel classjLabel;	private JComboBox jComboBox3;	private JLabel jLabel3;	private JButton button;	private int page;    private int row;    private JTable table;    private JLabel showSpeNameLabel;    private String subName="";	/**	* Auto-generated main method to display this JFrame	*/		public SpeSubUpdateFrame(int row,int page,JTable table) {		super();		this.row=row;		this.page=page;		this.table=table;		initGUI();		int width=Toolkit.getDefaultToolkit().getScreenSize().width;		int height=Toolkit.getDefaultToolkit().getScreenSize().height;		this.setLocation((width-400)/2, (height-300)/2);		this.setModal(true);	}		private void initGUI() {		try {			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);			getContentPane().setLayout(null);			this.setTitle("\u4fee\u6539\u4e13\u4e1a\u79d1\u76ee\u4fe1\u606f");			{				panel = new JPanel();				getContentPane().add(panel);				panel.setBounds(0, 0, 392, 273);				panel.setLayout(null);				{					classjLabel = new JLabel();					panel.add(classjLabel);					classjLabel.setText("\u79d1\u76ee\u540d\u79f0\uff1a");					classjLabel.setBounds(21, 84, 70, 14);				}				{					button = new JButton();					panel.add(button);					button.setText("\u63d0\u4ea4");					button.setBounds(273, 196, 63, 28);					button.addActionListener(new ActionListener() {						public void actionPerformed(ActionEvent evt) {							buttonActionPerformed(evt);						}					});				}				{					jLabel3 = new JLabel();					panel.add(jLabel3);					jLabel3.setText("\u4e13\u4e1a\u540d\u79f0\uff1a");					jLabel3.setBounds(21, 35, 70, 14);				}				{					ComboBoxModel jComboBox3Model = new DefaultComboBoxModel();					jComboBox3 = new JComboBox();					panel.add(jComboBox3);					jComboBox3.setModel(jComboBox3Model);					jComboBox3.setBounds(98, 77, 217, 21);					SpeSubAction ssa=new SpeSubAction();					ssa.initSubComboBox(jComboBox3);					this.subName=table.getValueAt(row,3).toString();					jComboBox3.setSelectedItem(this.subName);				}				{					String speName=table.getValueAt(row,1).toString();					showSpeNameLabel = new JLabel();					panel.add(showSpeNameLabel);					showSpeNameLabel.setBounds(98, 28, 217, 28);					showSpeNameLabel.setText(speName);				}			}			pack();			setSize(400, 300);		} catch (Exception e) {			e.printStackTrace();		}	}		private void buttonActionPerformed(ActionEvent evt) {		int control;		String speName=showSpeNameLabel.getText();		String subName=jComboBox3.getSelectedItem().toString();		if(this.subName.equals(subName)){			control=JOptionPane.showConfirmDialog(this, "真的要修改吗?","警告!",JOptionPane.OK_OPTION);			if(JOptionPane.OK_OPTION==control)				this.setVisible(false);		}		else{			control=JOptionPane.showConfirmDialog(this, "真的要修改吗?","警告!",JOptionPane.OK_OPTION);			if(JOptionPane.OK_OPTION==control){				SpeSubAction sa=new SpeSubAction();				boolean flag=sa.speSubUpdate(speName,subName,this.subName);				if(flag==true){					sa.init(table,page);					this.setVisible(false);					}				}			}		}	}

⌨️ 快捷键说明

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