基于java的英汉词典软件项目报告内容摘要:

ner { Box baseBox,boxv1,boxv2。 JLabel 标题。 JButton 确认 ,取消。 TextArea 条款。 TextField t1,t2,t3。 Register() { 标题 =new JLabel(英汉词典新用户注册 )。 确认 =new JButton(确认 )。 确认 .addActionListener(this)。 取消 =new JButton(取消 )。 取消 .addActionListener(this)。 条款 =new TextArea(3,6)。 t1=new TextField(12)。 t2=new TextField(12)。 t3=new TextField(12)。 条款 .setText(英汉词典使用规则 :\n \n 按照本协议的一下条款 \n 该授权为有限、非专用、不可传递、不可授权 \n 仅供您在您自己的电脑上使用。 )。 条款 .setEditable(false)。 boxv1=()。 (标题 )。 ((8))。 (new JLabel(用 户 名: ))。 ((8))。 (new JLabel(密 码: ))。 ((8))。 (new JLabel(密码确认: ))。 ((8))。 (new Checkbox( 我同意 ))。 ((8))。 (确认 )。 boxv2=()。 (new JLabel(欢迎注册 ))。 ((8))。 (t1)。 ((8))。 (t2)。 ((8))。 (t3)。 ((8))。 (条款 )。 (取消 )。 baseBox=()。 (boxv1)。 ((10))。 (boxv2)。 实训报告 11 setLayout(new FlowLayout())。 add(baseBox)。 setBounds(150,150,500,300)。 setVisible(true)。 validate()。 } public void actionPerformed(ActionEvent e) { if(()==确认 ) { ZhuCePan zhucepan=new ZhuCePan()。 (this,(),(),())。 Zhuce zhuce=new Zhuce()。 (this,(),())。 } if(()==取消 ) {(false)。 } } } 3.主界面 ( 1)管理员界面 import .*。 import .*。 import .*。 import .*。 实训报告 12 import .*。 import .*。 import。 class GuanLiYuan extends JFrame implements ActionListener,MouseListener { Clipboard clipboard=null。 JPopupMenu popup。 JTextArea area。 JMenuBar menubar。 JMenu menu1,menu2,menu3。 JMenuItem item1,item2,item3,item4,item5,item6,item7,item8,item9,copy,cut,paste。 JPanel p1,p2。 JScrollPane scrollpane。 JButton button1,button2,button3,button4,button5,button6。 JTextField textfield。 JLabel label。 FileDialog fd。 GuanLiYuan(String s) { setTitle(s)。 fd=new FileDialog(this,保存文件对话框 ,)。 (false)。 clipboard=getToolkit().getSystemClipboard()。 menubar=new JMenuBar()。 menu1=new JMenu(文件 )。 item1=new JMenuItem(英汉词典 )。 item8=new JMenuItem(汉英词典 )。 item2=new JMenuItem(备份词库 )。 item3=new JMenuItem(退出 )。 (item1)。 (item8)。 (item2)。 (item3)。 (this)。 (this)。 (this)。 (this)。 menu2=new JMenu(编辑 )。 item4=new JMenuItem(添加 )。 item5=new JMenuItem(修改 )。 item6=new JMenuItem(删除 )。 (item4)。 (item5)。 实训报告 13 (item6)。 (this)。 (this)。 (this)。 menu3=new JMenu(帮助 )。 item9=new JMenuItem(帮助 )。 item7=new JMenuItem(关于 )。 (item9)。 (item7)。 (this)。 (this)。 (menu1)。 (menu2)。 (menu3)。 setJMenuBar(menubar)。 p1=new JPanel()。 label=new JLabel(输入要查询的英语单词 :)。 (label)。 textfield=new JTextField(20)。 (textfield)。 (this)。 button4=new JButton(查询 )。 button6=new JButton(发音 )。 (button4)。 (button6)。 (this)。 (this)。 area=new JTextArea(60,60)。 (true)。 (this)。 scrollpane=new JScrollPane(area)。 p2=new JPanel()。 button1=new JButton(添加 )。 button2=new JButton(修改 )。 button3=new JButton(删除 )。 button5=new JButton(统计 )。 (button1)。 (button2)。 (button3)。 (button5)。 (this)。 (this)。 (this)。 (this)。 popup=new JPopupMenu()。 实训报告 14 copy=new JMenuItem(复制 )。 cut=new JMenuItem(剪切 )。 paste=new JMenuItem(粘贴 )。 (copy)。 (cut)。 (paste)。 (this)。 (this)。 (this)。 add(p1,)。 add(scrollpane,)。 add(p2,)。 addWindowListener(new WindowAdapter() {public void windowClosing(WindowEvent e) {(0)。 } })。 setBounds(100,100,550,400)。 setVisible(true)。 validate()。 } ( 2)客户界面 实训报告 15 import .*。 import。 import .*。 import .*。 import .*。 import .*。 import .*。 import。 class Kehu extends JFrame implements ActionListener,ListSelectionListener { JMenuBar menubar。 JMenu menu1,menu2,menu3,menu4。 JMenuItem item1,item2,item3,item4,item5,item6,copy,cut,paste,all,bangzhu,guanyu,item8,item9。 Clipboard clipboard=null。 //声明剪贴板对象 YouDialog youdialog。 EWindowDialog eWindowDialog。 JTextArea text。 实训报告 16 JButton button1,button2,button6。 JScrollPane scroll,scroll2。 Box box1,box2,box3,box4。 JLabel label。 JSplitPane splitOne。 JTextField text1。 String s=null,s1= 请输入您要查询的英语单词 :,s2=请输入您要查询的汉语单词 :。 JList list1。 Vector a=new Vector()。 JPopupMenu popupMenu。 FileDialog filedialog_save。 //声明文件对话筐 BufferedWriter out。 FileWriter tofile。 Kehu(String s) { super(s)。 list1=new JList(a)。 ((相关单词列表:))。 ()。 (this)。 scroll2=new JScrollPane(list1)。 text=new JTextArea(14,18)。 Font font=new Font(黑体 ,20)。 (font)。 (true)。 scroll=new JScrollPane(text)。 //(R_ALWAYS )。 (YS)。 splitOne=new JSplitPane(,true,scroll2,scroll)。 (1)。 (150)。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。