欢迎来到天天文库
浏览记录
ID:26167831
大小:53.00 KB
页数:8页
时间:2018-11-25
《des加密算法的java实现(窗口的实现部分)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、以下为DES加密算法的实现(附控制台输出调试代码)/**Window.java**Createdon__DATE__,__TIME__*/packagedeswindow;importjava.util.Scanner;/****@author__USER__*/publicclassWindowextendsjavax.swing.JFrame{/**CreatesnewformWindow*/publicWindow(){initComponents();}/**Thismethodiscalledfromwithintheconstructorto*in
2、itializetheform.*WARNING:DoNOTmodifythiscode.Thecontentofthismethodis*alwaysregeneratedbytheFormEditor.*///GEN-BEGIN:initComponents//privatevoidinitComponents(){button1=newjava.awt.Button();textField1=newjava.awt.TextField();t
3、extField2=newjava.awt.TextField();内容=newjava.awt.Label();密钥=newjava.awt.Label();textArea1=newjava.awt.TextArea();button2=newjava.awt.Button();setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);button1.setLabel("加密");button1.addActionListener(newjava.awt.event.Action
4、Listener(){publicvoidactionPerformed(java.awt.event.ActionEventevt){button1ActionPerformed(evt);}});textField1.setText("请输入明文或者密文");textField1.addActionListener(newjava.awt.event.ActionListener(){publicvoidactionPerformed(java.awt.event.ActionEventevt){textField1ActionPerformed(evt)
5、;}});textField2.setText("请输入密钥");textField2.addActionListener(newjava.awt.event.ActionListener(){publicvoidactionPerformed(java.awt.event.ActionEventevt){textField2ActionPerformed(evt);}});内容.setText("内容");密钥.setText("密钥");button2.setLabel("解密");button2.addActionListener(newjava.awt
6、.event.ActionListener(){publicvoidactionPerformed(java.awt.event.ActionEventevt){button2ActionPerformed(evt);}});javax.swing.GroupLayoutlayout=newjavax.swing.GroupLayout(getContentPane());getContentPane().setLayout(layout);layout.setHorizontalGroup(layout.createParallelGroup(javax.s
7、wing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGap(127,127,127).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(textArea1,javax
8、.swing.GroupLayout.
此文档下载收益归作者所有