package DESDEMO;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* DES_show.java
*
* Created on 2009-4-1, 7:00:37
*/
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
/**
*
* @author jewelknife
*/
public class DES_show extends javax.swing.JFrame {
/** Creates new form DES_show */
public DES_show() {
des=new DES();
initComponents();
// jfilechoose.removeChoosableFileFilter(jfilechoose.getAcceptAllFileFilter()); //移去所有文件过滤器
jfilechoose.addChoosableFileFilter(new MyFileFilter("txt","文本文件")); //增加文件过滤器,接爱text文件
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jDialog1 = new javax.swing.JDialog();
jPanel5 = new javax.swing.JPanel();
jPanel8 = new javax.swing.JPanel();
d_jButton_encoding = new javax.swing.JButton();
d_jButton_cls = new javax.swing.JButton();
jPanel9 = new javax.swing.JPanel();
jTextField_text = new javax.swing.JTextField();
jTextField_code = new javax.swing.JTextField();
jTextField_keytext = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jPanel6 = new javax.swing.JPanel();
jScrollPane5 = new javax.swing.JScrollPane();
jTable_pt = new javax.swing.JTable();
jLabel14 = new javax.swing.JLabel();
jPanel7 = new javax.swing.JPanel();
d_jTextField_ip = new javax.swing.JTextField();
d_jTextField_unip = new javax.swing.JTextField();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jfilechoose = new javax.swing.JFileChooser();
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea_text = new javax.swing.JTextArea();
jTextField_key = new javax.swing.JTextField();
jScrollPane2 = new javax.swing.JScrollPane();
jTextArea_decode = new javax.swing.JTextArea();
jButton_encode = new javax.swing.JButton();
jButton_decode = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jScrollPane3 = new javax.swing.JScrollPane();
jTextArea_code = new javax.swing.JTextArea();
jPanel2 = new javax.swing.JPanel();
jScrollPane4 = new javax.swing.JScrollPane();
jTable_showkey = new javax.swing.JTable();
jPanel3 = new javax.swing.JPanel();
jTextField_fileRead = new javax.swing.JTextField();
jButton_selectfile = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jTextField_fileWrite = new javax.swing.JTextField();
jButton_savefile = new javax.swing.JButton();
jTextField_filekey = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
jButton_codefile = new javax.swing.JButton();
jButton_decodefile = new javax.swing.JButton();
jPanel4 = new javax.swing.JPanel();
jButton_show = new javax.swing.JButton();
jButton_cls = new javax.swing.JButton();
jButton_exit = new javax.swing.JButton();
jDialog1.setTitle("DES加密简单过程演示 by jewelknife");
jDialog1.setBounds(new java.awt.Rectangle(400, 300, 520, 635));
jDialog1.setResizable(false);
jPanel5.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jPanel8.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
d_jButton_encoding.setText("加密");
d_jButton_encoding.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
d_jButton_encodingActionPerformed(evt);
}
});
d_jButton_cls.setText("清屏");
d_jButton_cls.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
d_jButton_clsActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(d_jButton_cls, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(d_jButton_encoding, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE))
.addContainerGap(12, Short.MAX_VALUE))
);
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(d_jButton_encoding)
.addGap(32, 32, 32)
.addComponent(d_jButton_cls)
.addContainerGap(27, Short.MAX_VALUE))
);
jPanel9.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabel8.setText("明文:");
jLabel9.setText("密钥:");
jLabel11.setText("密文:");
javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
jPanel9.setLayout(jPanel9Layout);
jPanel9Layout.setHorizontalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel8)
.addComponent(jLabel9)
.addComponent(jLabel11))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField_code, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
.addComponent(jTextField_text, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
.addComponent(jTextField_keytext, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE))
.addContainerGap())
);
jPanel9Layout.setVerticalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addGap(19, 19, 19)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField_text, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8))
.add
- 1
- 2
- 3
- 4
- 5
- 6
前往页