package cn.com.edu.view.frame;
import java.awt.AWTException;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.GridBagLayout;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
import org.jvnet.substance.SubstanceLookAndFeel;
import org.jvnet.substance.skin.FindingNemoSkin;
import cn.com.edu.action.JMenuItemAction;
import cn.com.edu.action.MainFrameAction;
import cn.com.edu.util.GBC;
import cn.com.edu.view.panel.AddStudentInfoPanel;
import cn.com.edu.view.panel.FindStudentInfoPanel;
/**
* 教务管理系统主界面
*
* @author Administrator
*
*/
public class MainFrame extends JFrame {
private static MainFrame instance;
private JMenuBar bar;// 菜单条
private JMenu studentJMenu;// 菜单
private JMenu teacherJMenu;// 菜单
private JPanel center = new JPanel();// 中心面板用来放置卡片
private CardLayout card = new CardLayout();// 卡片布局
private JPanel west;// 西边面板
private JSplitPane split;// 分割面板
private JToolBar tool;// 工具条
private MainFrameAction action = new MainFrameAction(this);// 按钮事件对象
private JMenuItemAction menuItemAction = new JMenuItemAction(this);// 菜单事件对象
private SystemTray tray;// 系统托盘
private TrayIcon trayIcon;// 设置系统托盘的图片
/**
* 使用单子设计模式主界面对象
*
*/
private MainFrame() {
init();
}
public static MainFrame getInstance() {
if (instance == null) {
instance = new MainFrame();
}
return instance;
}
/**
* 初始化主界面
1