?? aboutsystem.java
字號:
//系統(tǒng)幫助
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.event.*;
import javax.swing.text.html.*;
import java.io.*;
import java.util.*;
public class AboutSystem implements TreeSelectionListener
{public JLabel jlb1;
public JFrame frame;
public JTree tree=null;
public JScrollPane js;
public JEditorPane tp;
public DefaultMutableTreeNode root,xtjj,xtpz,xgcz,xtsz,tssz,tsgl,dzgl,xtcy,tjpm,tszl,jsgl,xjgl,hsgl,gsgl,dzzj,dzxx,dzgs,
tscx,jycx,gccx,gscx,dzcx,jrcx,gjl,tsgzy,dlzc,ztl;
public AboutSystem()
{JFrame.setDefaultLookAndFeelDecorated(true);
frame=new JFrame("系統(tǒng)幫助");
ImageIcon icon=new ImageIcon("images/home.gif");
frame.setIconImage(icon.getImage());
frame.setResizable(false);
Font font1=new Font("宋體",Font.PLAIN,13);
Container content=frame.getContentPane();
Toolkit tool=frame.getToolkit();
Dimension wndsize=tool.getScreenSize();
//初始化各個組件
jlb1=new JLabel(new ImageIcon("images/top.jpg"));
jlb1.setBounds(0,0,770,100);
jlb1.setBorder(BorderFactory.createLoweredBevelBorder());
root=new DefaultMutableTreeNode("商院圖書館管理系統(tǒng)");
xtjj=new DefaultMutableTreeNode("系統(tǒng)簡介");
xtpz=new DefaultMutableTreeNode("系統(tǒng)配置");
xgcz=new DefaultMutableTreeNode("相關操作");
dlzc=new DefaultMutableTreeNode("用戶登錄、注冊");
xtsz=new DefaultMutableTreeNode("系統(tǒng)設置");
tssz=new DefaultMutableTreeNode("圖書設置");
tsgl=new DefaultMutableTreeNode("圖書管理");
tszl=new DefaultMutableTreeNode("圖書資料管理");
jsgl=new DefaultMutableTreeNode("借閱圖書管理");
xjgl=new DefaultMutableTreeNode("續(xù)借圖書管理");
hsgl=new DefaultMutableTreeNode("歸還圖書管理");
gsgl=new DefaultMutableTreeNode("掛失圖書管理");
dzgl=new DefaultMutableTreeNode("讀者管理");
dzzj=new DefaultMutableTreeNode("讀者類型、有效證件");
dzxx=new DefaultMutableTreeNode("讀者資料管理");
dzgs=new DefaultMutableTreeNode("讀者掛失、解除掛失、到期續(xù)證");
xtcy=new DefaultMutableTreeNode("系統(tǒng)查詢");
tscx=new DefaultMutableTreeNode("圖書信息查詢");
jycx=new DefaultMutableTreeNode("借閱圖書查詢");
gccx=new DefaultMutableTreeNode("歸還/超期圖書查詢");
gscx=new DefaultMutableTreeNode("掛失圖書查詢");
dzcx=new DefaultMutableTreeNode("讀者信息查詢");
jrcx=new DefaultMutableTreeNode("今日信息查詢");
tjpm=new DefaultMutableTreeNode("統(tǒng)計排名");
gjl=new DefaultMutableTreeNode("工具欄");
tsgzy=new DefaultMutableTreeNode("圖書館主頁");
ztl=new DefaultMutableTreeNode("狀態(tài)欄");
root.add(xtjj);root.add(xtpz);root.add(xgcz);xgcz.add(dlzc);
xgcz.add(xtsz);xgcz.add(tssz);xgcz.add(tsgl);tsgl.add(tszl);
tsgl.add(jsgl);tsgl.add(xjgl);tsgl.add(hsgl);tsgl.add(gsgl);
xgcz.add(dzgl);dzgl.add(dzzj);dzgl.add(dzxx);dzgl.add(dzgs);
xgcz.add(xtcy);xtcy.add(tscx);xtcy.add(jycx);xtcy.add(gccx);
xtcy.add(gscx);xtcy.add(dzcx);xtcy.add(jrcx);xgcz.add(tjpm);
xgcz.add(gjl);xgcz.add(tsgzy);xgcz.add(ztl);
tree=new JTree(root);
tp=new JEditorPane();
tp.setEditable(false);
tp.setContentType("text/html");
tp.setFont(font1);
String home=null;
try{
home="file:"
+System.getProperty("user.dir")
+System.getProperty("file.separator")
+"LibraryHome/bg.html";
try
{tp.setPage(home);}
catch(IOException ioe)
{System.err.println("Attempted to read a bad URL:"+home);}
}
catch(Exception es)
{ System.err.println("Couldn't create help URL:"+home);}
js=new JScrollPane(tp);
js.setFont(font1);
js.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
js.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
JSplitPane splitpane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,false,tree,js);
tree.addTreeSelectionListener(this);
splitpane.setBounds(0,100,770,490);
content.setLayout(null);
content.add(jlb1);
content.add(splitpane);
frame.setBounds(150,80,770,600);
frame.setResizable(false);
frame.setVisible(true);
}
public void valueChanged(TreeSelectionEvent e)
{if(e.getSource()==tree)
{DefaultMutableTreeNode node=(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
if(node.isLeaf())
{String str=node.toString();
if(str.equals("系統(tǒng)簡介"))
{String home=null;
try{
home="file:"
+System.getProperty("user.dir")
+System.getProperty("file.separator")
+"LibraryHome/xtjj.html";
try
{tp.setPage(home);}
catch(IOException ioe)
{System.err.println("Attempted to read a bad URL:"+home);}
}
catch(Exception es)
{ System.err.println("Couldn't create help URL:"+home);}
}
else if(str.equals("系統(tǒng)配置"))
{String home1=null;
try{
home1="file:"
+System.getProperty("user.dir")
+System.getProperty("file.separator")
+"LibraryHome/xtpz.html";
try
{tp.setPage(home1);}
catch(IOException ioe)
{System.err.println("Attempted to read a bad URL:"+home1);}
}
catch(Exception es)
{ System.err.println("Couldn't create help URL:"+home1);}
}
else if(str.equals("系統(tǒng)設置"))
{String home2=null;
try{
home2="file:"
+System.getProperty("user.dir")
+System.getProperty("file.separator")
+"LibraryHome/xtsz.html";
try
{tp.setPage(home2);}
catch(IOException ioe)
{System.err.println("Attempted to read a bad URL:"+home2);}
}
catch(Exception es)
{ System.err.println("Couldn't create help URL:"+home2);}
}
else if(str.equals("圖書設置"))
{String home3=null;
try{
home3="file:"
+System.getProperty("user.dir")
+System.getProperty("file.separator")
+"LibraryHome/tssz.html";
try
{tp.setPage(home3);}
catch(IOException ioe)
{System.err.println("Attempted to read a bad URL:"+home3);}
}
catch(Exception es)
{ System.err.println("Couldn't create help URL:"+home3);}
}
else if(str.equals("圖書資料管理"))
{String home4=null;
try{
home4="file:"
+System.getProperty("user.dir")
+System.getProperty("file.separator")
+"LibraryHome/tszl.html";
try
{tp.setPage(home4);}
catch(IOException ioe)
{System.err.println("Attempted to read a bad URL:"+home4);}
}
catch(Exception es)
{ System.err.println("Couldn't create help URL:"+home4);}
}
else if(str.equals("借閱圖書管理"))
{String home5=null;
try{
home5="file:"
+System.getProperty("user.dir")
+System.getProperty("file.separator")
+"LibraryHome/jsgl.html";
try
{tp.setPage(home5);}
catch(IOException ioe)
{System.err.println("Attempted to read a bad URL:"+home5);}
}
catch(Exception es)
{ System.err.println("Couldn't create help URL:"+home5);}
}
else if(str.equals("續(xù)借圖書管理"))
{String home6=null;
try{
home6="file:"
+System.getProperty("user.dir")
+System.getProperty("file.separator")
+"LibraryHome/xjgl.html";
try
{tp.setPage(home6);}
catch(IOException ioe)
{System.err.println("Attempted to read a bad URL:"+home6);}
}
catch(Exception es)
{ System.err.println("Couldn't create help URL:"+home6);}
}
else if(str.equals("歸還圖書管理"))
{String home7=null;
try{
home7="file:"
+System.getProperty("user.dir")
+System.getProperty("file.separator")
+"LibraryHome/ghgl.html";
try
{tp.setPage(home7);}
catch(IOException ioe)
{System.err.println("Attempted to read a bad URL:"+home7);}
}
catch(Exception es)
{ System.err.println("Couldn't create help URL:"+home7);}
}
else if(str.equals("掛失圖書管理"))
{String home8=null;
try{
home8="file:"
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -