📄 文件加密.java
字号:
/* * 文件加密.java * * Created on 2008年12月5日, 下午6:16 *//* * * * @author Administrator */import javax.swing.*;import java.io.*;import java.lang.*;//import org.*; public class 文件加密 extends javax.swing.JFrame { String wzlj; File file; /** Creates new form 文件加密 */ public 文件加密() { initComponents(); } /** 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() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); mima = new javax.swing.JTextField(); chongshumima = new javax.swing.JTextField(); tishi = new javax.swing.JLabel(); lujing = new javax.swing.JLabel(); xuanze = new javax.swing.JButton(); jiami = new javax.swing.JButton(); fanhui = new javax.swing.JButton(); quxiao = new javax.swing.JButton(); mimats = new javax.swing.JLabel(); mimacsti = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("文件加密"); addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { formKeyPressed(evt); } }); jLabel1.setFont(new java.awt.Font("宋体", 1, 36)); jLabel1.setText("文件加密"); jLabel2.setFont(new java.awt.Font("宋体", 1, 14)); jLabel2.setText("请输入密码:"); jLabel3.setFont(new java.awt.Font("宋体", 1, 14)); jLabel3.setText("请重新输入密码:"); mima.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { mimaKeyPressed(evt); } }); chongshumima.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { chongshumimaKeyPressed(evt); } }); tishi.setText("请输入任意长度的大小写字母组合!!!"); lujing.setText("请选择路径!"); xuanze.setFont(new java.awt.Font("宋体", 1, 12)); xuanze.setText("选 择"); xuanze.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { xuanzeActionPerformed(evt); } }); jiami.setFont(new java.awt.Font("宋体", 1, 14)); // NOI18N jiami.setText("确定加密"); jiami.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jiamiActionPerformed(evt); } }); fanhui.setFont(new java.awt.Font("宋体", 1, 14)); fanhui.setText("返 回"); fanhui.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { fanhuiActionPerformed(evt); } }); quxiao.setFont(new java.awt.Font("宋体", 1, 14)); quxiao.setText("取 消"); quxiao.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { quxiaoActionPerformed(evt); } }); mimats.setForeground(new java.awt.Color(255, 51, 51)); mimacsti.setForeground(new java.awt.Color(255, 51, 51)); jLabel4.setText("关于"); jLabel4.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel4MouseClicked(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(46, 46, 46) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3) .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(mima, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE) .addComponent(chongshumima, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(76, 76, 76) .addComponent(jiami) .addGap(41, 41, 41) .addComponent(fanhui) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 65, Short.MAX_VALUE) .addComponent(quxiao))) .addGap(6, 6, 6)) .addGroup(layout.createSequentialGroup() .addComponent(lujing, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(mimacsti, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(mimats, javax.swing.GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE)) .addComponent(xuanze)) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(183, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(tishi, javax.swing.GroupLayout.PREFERRED_SIZE, 231, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(179, 179, 179)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(517, Short.MAX_VALUE) .addComponent(jLabel4) .addGap(52, 52, 52)) ); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {fanhui, quxiao}); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {mimacsti, mimats}); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(27, 27, 27) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(9, 9, 9) .addComponent(tishi) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(mima, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(mimats, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(27, 27, 27) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(chongshumima, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(mimacsti, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(27, 27, 27) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(xuanze) .addComponent(lujing, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(quxiao) .addComponent(fanhui) .addComponent(jiami)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel4) .addGap(14, 14, 14)) ); layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {fanhui, jiami, quxiao}); layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {mimacsti, mimats}); java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width-601)/2, (screenSize.height-357)/2, 601, 357); }// </editor-fold>//GEN-END:initComponentsprivate void fanhuiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fanhuiActionPerformed
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -