?? runframe.java
字號:
import java.awt.*;
import java.awt.event.*;
import java.awt.Rectangle;
import java.awt.Color;
import java.awt.Font;
import java.io.*;
import java.util.*;
import java.sql.*;
import javax.sql.*;
import javax.swing.*;import javax.swing.border.Border;
/*import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JToolBar;
import javax.swing.JButton;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.JTextArea;
import javax.swing.BorderFactory;
import javax.swing.JScrollPane;*/
public class runFrame extends JFrame {
private static String databaseName="";private static String txtAddress="";/////////////////////////////////////////////////////////////////////////////////////////////////////
JPanel contentPane;
JPanel tempPanel;
JMenuBar jMenuBar1 = new JMenuBar();
JMenu jMenuFile = new JMenu();
JMenuItem jMenuFileExit = new JMenuItem();
JMenu jMenuHelp = new JMenu();
JMenuItem jMenuHelpAbout = new JMenuItem();
JMenu jMenuInput = new JMenu();
JMenuItem jMenuInputEmail = new JMenuItem();
JMenu jMenuInquire = new JMenu();
JMenu jMenuInquireMission = new JMenu();
JMenuItem jMenuInquireOverMission = new JMenuItem();
JMenuItem jMenuInquireWaitingMission = new JMenuItem();
JMenuItem jMenuInquirePeopleInfor = new JMenuItem();
JMenuItem jMenuInquireDB = new JMenuItem();
JTextField jTextField1 = null;
JComboBox jComboBox1 = null;
JComboBox jComboBox2 = null;
JComboBox jComboBox3 =null;
JTextArea jTextArea1=null;
Border border1 = BorderFactory.createLineBorder(Color.lightGray, 1);
public runFrame()
{
try
{
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
}
catch (Exception exception)
{
exception.printStackTrace();
}
}
private void jbInit() throws Exception
{
contentPane = (JPanel) getContentPane();
tempPanel = (JPanel) getContentPane();
contentPane.setLayout(null);
setSize(new Dimension(800, 600));
setTitle("Agent管理");
jMenuInput.setText("信息輸入");
jMenuInputEmail.setText("郵件輸入");
jMenuInquire.setText("查 看");
jMenuInquireMission.setText("任務(wù)查詢");
jMenuInquireOverMission.setText("已完成任務(wù)");
jMenuInquireWaitingMission.setText("待確認任務(wù)");
jMenuInquirePeopleInfor.setText("信息查詢");
jMenuInquireDB.setText("本地數(shù)據(jù)庫信息");
jMenuFile.setText("File");
jMenuFileExit.setText("Exit");
jMenuFileExit.addActionListener(new runFrame_jMenuFileExit_ActionAdapter(this));
jMenuHelp.setText("Help");
jMenuHelpAbout.setText("About");
jMenuHelpAbout.addActionListener(new runFrame_jMenuHelpAbout_ActionAdapter(this));
jMenuBar1.add(jMenuInput);
jMenuInput.add(jMenuInputEmail);
jMenuBar1.add(jMenuInquire);
jMenuInquire.add(jMenuInquireDB);
jMenuInquireDB.addActionListener(new runFrame_jMenuInquireDB_ActionAdapter(this));
jMenuInquire.add(jMenuInquirePeopleInfor);
jMenuInquirePeopleInfor.addActionListener(new runFrame_jMenuInquirePeopleInfor_ActionAdapter(this));
jMenuInquire.add(jMenuInquireMission);
jMenuInquireMission.add(jMenuInquireOverMission);
jMenuInquireOverMission.addActionListener(new runFrame_jMenuInquireOverMission_ActionAdapter(this));
jMenuInquireMission.add(jMenuInquireWaitingMission);
jMenuInquireWaitingMission.addActionListener(new runFrame_jMenuInquireWaitingMission_ActionAdapter(this));
jMenuBar1.add(jMenuFile);
jMenuFile.add(jMenuFileExit);
jMenuBar1.add(jMenuHelp);
jMenuHelp.add(jMenuHelpAbout);
setJMenuBar(jMenuBar1);
}
void jMenuInquireOverMission_actionPerformed(ActionEvent actionEvent)
{
tempPanel.removeAll();this.repaint();
tempPanel = (JPanel) getContentPane();
tempPanel.setLayout(null);
tempPanel.setSize(800, 600);
JScrollPane jsp1=new JScrollPane();
jsp1.setSize(750,500);
jsp1.setLocation(25,30);
jsp1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jsp1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
jTextArea1 = new JTextArea();
jTextArea1.setBackground(Color.white);
jTextArea1.setBorder(BorderFactory.createLineBorder(Color.lightGray));
jTextArea1.setEditable(false);
//jTextArea1.setLineWrap(true);
JLabel jLabel1 = new JLabel();
jLabel1.setSize(750,15);
jLabel1.setLocation(25,15);
jLabel1.setFont(new java.awt.Font("宋體", Font.BOLD, 12));
jLabel1.setText("已完成任務(wù):");
File file=null;
FileReader fr=null;
BufferedReader br=null;
Key kk=new Key(txtAddress);
String s="",temp="";
try
{
file=new File(txtAddress+"MissionManage.txt");
fr=new FileReader(file);
}
catch(FileNotFoundException e){}
br=new BufferedReader(fr);
//kk.decrypt(txtAddress+"MissionManage.txt");
dealMessage dm=new dealMessage();
try
{
while((temp=br.readLine())!=null)
{
temp=temp.trim();
if((temp.indexOf("-----"))==-1)
{
temp=dm.chineseOutput(1,temp);
}
else
{
temp="====================================================================================";
}
jTextArea1.append(temp+"\n");
}
}
catch(Exception e){}
//kk.encryption(txtAddress+"MissionManage.txt");
tempPanel.add(jLabel1);
tempPanel.add(jsp1);
jsp1.getViewport().add(jTextArea1);
}
void jMenuInquireWaitingMission_actionPerformed(ActionEvent actionEvent)
{tempPanel.removeAll();this.repaint();
tempPanel = (JPanel) getContentPane();
tempPanel.setLayout(null);
tempPanel.setSize(800, 600);
JScrollPane jsp1=new JScrollPane();
jsp1.setSize(750,500);
jsp1.setLocation(25,30);
jsp1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jsp1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
jTextArea1 = new JTextArea();
jTextArea1.setBackground(Color.white);
jTextArea1.setBorder(BorderFactory.createLineBorder(Color.lightGray));
jTextArea1.setEditable(false);
//jTextArea1.setLineWrap(true);
JLabel jLabel1 = new JLabel();
jLabel1.setSize(750,15);
jLabel1.setLocation(25,15);
jLabel1.setFont(new java.awt.Font("宋體", Font.BOLD, 12));
jLabel1.setText("未完成任務(wù):");
File file=null;
FileReader fr=null;
BufferedReader br=null;
Key kk=new Key(txtAddress);
String s="",temp="";
try
{
file=new File(txtAddress+"MissionManageTemp.txt");
fr=new FileReader(file);
}
catch(FileNotFoundException e){}
br=new BufferedReader(fr);
//kk.decrypt(txtAddress+"MissionManageTemp.txt");
dealMessage dm=new dealMessage();
try
{
while((temp=br.readLine())!=null)
{
temp=temp.trim();
if((temp.indexOf("-----"))==-1)
{
temp=dm.chineseOutput(0,temp);
}
else
{
temp="============================================================";
}
jTextArea1.append(temp+"\n");
}
}
catch(Exception e){}
//kk.encryption(txtAddress+"MissionManageTemp.txt");
tempPanel.add(jLabel1);
tempPanel.add(jsp1);
jsp1.getViewport().add(jTextArea1);
}
void jMenuFileExit_actionPerformed(ActionEvent actionEvent) {
System.exit(0);
}
void jMenuInquireDB_actionPerformed(ActionEvent actionEvent) {
tempPanel.removeAll();this.repaint();
tempPanel = (JPanel) getContentPane();
tempPanel.setLayout(null);
tempPanel.setSize(800, 600);
jTextArea1 = new JTextArea();
jTextArea1.setBackground(SystemColor.control);
jTextArea1.setBorder(BorderFactory.createEmptyBorder());
jTextArea1.setSize(300,200);
jTextArea1.setLocation(250,200);
jTextArea1.setFont(new java.awt.Font("宋體", Font.BOLD, 12));
jTextArea1.setEditable(false);
jTextArea1.append("數(shù)據(jù)庫名稱:\t"+databaseName+"\n");
jTextArea1.append("\n數(shù)據(jù)庫類型:\t");
String s="";
sqlOperation so=new sqlOperation();
ResultSet rs=so.ResultSetFromDB("select * from DBINFORMATION where DBNAME='"+databaseName+"'");
try
{
if(rs.next())
{
s=rs.getString("DBTYPE");
jTextArea1.append(s+"\n");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -