package main_frame;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import java.awt.Color;
import javax.swing.BorderFactory;
import javax.swing.JToolBar;
import javax.swing.border.Border;
import javax.swing.JToggleButton;
import javax.swing.JEditorPane;
import javax.swing.JSpinner;
import javax.swing.JSlider;
import javax.swing.JMenuBar;
import javax.swing.JSplitPane;
import javax.swing.JTextPane;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.Icon;
import javax.swing.border.EtchedBorder;
import java.awt.Font;
import javax.swing.Box;
import java.awt.Component;
import javax.swing.JScrollBar;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
/**
* import package
*/
import today_list.*;
import user_help.*;
import list_all.*;
import new_memoire.*;
import dboperate.*;
import java.awt.event.MouseEvent;
import system_setting.Memoire_Setting;
import awokeOperate.ShowFrame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.Dimension;
import com.sun.media.sound.Toolkit;
/**
* <p>Title:勿忘软件,lzquan </p>
*
* <p>Description:勿忘软件 </p>
*
* <p>Copyright: 泉水依然 Copyright (c) 2007-03-20</p>
*
* <p>Company: 泉水依然</p>
*
* @author :权哥,湖南农业大学科学技术师范学院04计算机教育班.
*
* QQ:25241418
*/
public class mainFrame extends JFrame implements Runnable{
xmlConn notForgetXmlConn = null;//new xmlConn("Not_Forget",9);
/**
* 新建对象,用来获取其它窗体的组件.
*/
Object[][] Data = null;//notForgetXmlConn.getData();//获取所有记录.
Object[][] compareDate = null;
defaule_show ds = new defaule_show();
Today_List tl = new Today_List();
//所有列表.
List_All list_all = new List_All();
//创建更新xml对象.
XmlUpdate xmlUpdate = new XmlUpdate();
JPanel jPanel1 = new JPanel();
XYLayout xYLayout1 = new XYLayout();
JPanel jPanel2 = new JPanel();
Border border1 = BorderFactory.createMatteBorder(6, 6, 6, 6, Color.gray);
JToolBar jToolBar1 = new JToolBar();
Border border2 = BorderFactory.createEtchedBorder(EtchedBorder.RAISED,
Color.white, new Color(165, 163, 151));
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
JToolBar jToolBar2 = new JToolBar();
JButton jButton4 = new JButton();
JButton jButton5 = new JButton();
JButton jButton6 = new JButton();
JButton jButton7 = new JButton();
JButton jButton8 = new JButton();
JToolBar jToolBar3 = new JToolBar();
JButton jButton9 = new JButton();
PaneLayout paneLayout1 = new PaneLayout();
XYLayout xYLayout2 = new XYLayout();
JLabel statusBar = new JLabel();
Object[] awokeData = new Object[9];//提醒数据.
public int todayRow;//统计今天有多少行.
public boolean isNewMemoire = false;//表示当前时候新建.如果新建了必须重新获取记录值.
public void setisNewMemoire(){
this.isNewMemoire = true;
}
public mainFrame() {
try {
this.notForgetXmlConn = new xmlConn("Not_Forget",9);
this.Data = notForgetXmlConn.getData();//获取所有记录.
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
this.getTodayData(this.Data);
this.setTitle("-- ^_^ -- 勿忘 -- 提醒簿 -- ^_^ --");
this.setSize(500,400);
this.setResizable(false);//固定窗体大小
this.setDefaultCloseOperation(this.HIDE_ON_CLOSE);//关闭窗口时退出
getContentPane().setLayout(xYLayout1);
jToolBar1.setLayout(xYLayout1);
this.getContentPane().setBackground(new Color(227, 228, 241));
xYLayout1.setWidth(500);
xYLayout1.setHeight(400);
jPanel1.setBorder(BorderFactory.createEtchedBorder());
jPanel1.setLayout(xYLayout2);
jPanel2.setBorder(BorderFactory.createLoweredBevelBorder());
jPanel2.setLayout(paneLayout1);
jToolBar1.setToolTipText("");
jButton1.setFont(new java.awt.Font("宋体", Font.PLAIN, 15));
jButton1.setText("新建");
jButton1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
}
});
jButton2.setFont(new java.awt.Font("宋体", Font.PLAIN, 15));
jButton2.setText("今日");
jButton2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton2_actionPerformed(e);
}
});
jButton3.setFont(new java.awt.Font("宋体", Font.PLAIN, 15));
jButton3.setText("列表");
jButton3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton3_actionPerformed(e);
}
});
jButton4.setFont(new java.awt.Font("宋体", Font.PLAIN, 15));
jButton4.setText("修改");
jButton4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton4_actionPerformed(e);
}
});
jButton5.setFont(new java.awt.Font("宋体", Font.PLAIN, 15));
jButton5.setText("删除");
jButton5.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton5_actionPerformed(e);
}
});
jButton6.setFont(new java.awt.Font("宋体", Font.PLAIN, 15));
jButton6.setText("过滤");
jButton6.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton6_actionPerformed(e);
}
});
jButton7.setFont(new java.awt.Font("宋体", Font.PLAIN, 15));
jButton7.setText("设置");
jButton7.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton7_actionPerformed(e);
}
});
jButton8.setFont(new java.awt.Font("宋体", Font.PLAIN, 15));
jButton8.setText("帮助");
jButton8.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton8_actionPerformed(e);
}
});
jButton9.setFont(new java.awt.Font("宋体", Font.PLAIN, 15));
jButton9.setText("退出");
jButton9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton9_actionPerformed(e);
}
});
statusBar.setText("-- ^_^ -- 欢迎使用勿忘软件 -- ^_^ --");
this.getContentPane().add(jPanel1, new XYConstraints( 0, 329, 506, 32));
this.getContentPane().add(jToolBar1, new XYConstraints( -3, 0, 507, 69));
jToolBar1.add(jButton1, new XYConstraints(2, 10, 44, 51));
jToolBar1.add(jButton3, new XYConstraints(97, 10, 44, 51));
jToolBar1.add(jButton4, new XYConstraints(166, 10, 44, 51));
jToolBar1.add(jButton6, new XYConstraints(263, 10, 44, 51));
jToolBar1.add(jButton5, new XYConstraints(215, 10, 44, 51));
jToolBar1.add(jButton7, new XYConstraints(326, 10, 44, 51));
jToolBar1.add(jButton2, new XYConstraints(50, 10, 44, 51));
jToolBar1.add(jButton8, new XYConstraints(372, 10, 44, 51));
jToolBar1.add(jButton9, new XYConstraints(420, 10, 44, 51));
jToolBar1.add(jToolBar3, new XYConstraints(311, 0, 15, 67));
jToolBar1.add(jToolBar2, new XYConstraints(14