📄 aboutsystem.java
字号:
//系统帮助
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("系统帮助");
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("商院图书馆管理系统");
xtjj=new DefaultMutableTreeNode("系统简介");
xtpz=new DefaultMutableTreeNode("系统配置");
xgcz=new DefaultMutableTreeNode("相关操作");
dlzc=new DefaultMutableTreeNode("用户登录、注册");
xtsz=new DefaultMutableTreeNode("系统设置");
tssz=new DefaultMutableTreeNode("图书设置");
tsgl=new DefaultMutableTreeNode("图书管理");
tszl=new DefaultMutableTreeNode("图书资料管理");
jsgl=new DefaultMutableTreeNode("借阅图书管理");
xjgl=new DefaultMutableTreeNode("续借图书管理");
hsgl=new DefaultMutableTreeNode("归还图书管理");
gsgl=new DefaultMutableTreeNode("挂失图书管理");
dzgl=new DefaultMutableTreeNode("读者管理");
dzzj=new DefaultMutableTreeNode("读者类型、有效证件");
dzxx=new DefaultMutableTreeNode("读者资料管理");
dzgs=new DefaultMutableTreeNode("读者挂失、解除挂失、到期续证");
xtcy=new DefaultMutableTreeNode("系统查询");
tscx=new DefaultMutableTreeNode("图书信息查询");
jycx=new DefaultMutableTreeNode("借阅图书查询");
gccx=new DefaultMutableTreeNode("归还/超期图书查询");
gscx=new DefaultMutableTreeNode("挂失图书查询");
dzcx=new DefaultMutableTreeNode("读者信息查询");
jrcx=new DefaultMutableTreeNode("今日信息查询");
tjpm=new DefaultMutableTreeNode("统计排名");
gjl=new DefaultMutableTreeNode("工具栏");
tsgzy=new DefaultMutableTreeNode("图书馆主页");
ztl=new DefaultMutableTreeNode("状态栏");
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("系统简介"))
{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("系统配置"))
{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("系统设置"))
{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("续借图书管理"))
{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 + -