⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 文件解密.java

📁 小型的课程设计
💻 JAVA
字号:
/* * 文件解密.java * * Created on 2008年12月5日, 下午6:16 *//** * * @author  Administrator */import javax.swing.*;import java.io.*;public class 文件解密 extends javax.swing.JFrame {    /** 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();        lujing = new javax.swing.JLabel();        jButton1 = new javax.swing.JButton();        jLabel2 = new javax.swing.JLabel();        jTextField1 = new javax.swing.JTextField();        jButton2 = new javax.swing.JButton();        jButton3 = new javax.swing.JButton();        jButton4 = new javax.swing.JButton();        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);        setTitle("文件解密");        jLabel1.setFont(new java.awt.Font("宋体", 1, 36)); // NOI18N        jLabel1.setText("文件解密");        lujing.setText("请选择路径!");        jButton1.setFont(new java.awt.Font("宋体", 1, 12)); // NOI18N        jButton1.setText("选 择");        jButton1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton1ActionPerformed(evt);            }        });        jLabel2.setFont(new java.awt.Font("宋体", 1, 14)); // NOI18N        jLabel2.setText("请输入密码:");        jTextField1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jTextField1ActionPerformed(evt);            }        });        jButton2.setFont(new java.awt.Font("宋体", 1, 14)); // NOI18N        jButton2.setText("文件解密");        jButton2.setActionCommand("确定解密");        jButton3.setFont(new java.awt.Font("宋体", 1, 14)); // NOI18N        jButton3.setText("返  回");        jButton3.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton3ActionPerformed(evt);            }        });        jButton4.setFont(new java.awt.Font("宋体", 1, 14)); // NOI18N        jButton4.setText("取  消");        jButton4.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton4ActionPerformed(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(101, 101, 101)                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)                .addContainerGap(116, Short.MAX_VALUE))            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()                .addGap(49, 49, 49)                .addComponent(jLabel2)                .addGap(38, 38, 38)                .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE)                .addGap(42, 42, 42))            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)                    .addGroup(layout.createSequentialGroup()                        .addContainerGap()                        .addComponent(jButton2)                        .addGap(18, 18, 18)                        .addComponent(jButton3)                        .addGap(17, 17, 17)                        .addComponent(jButton4)                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))                    .addGroup(layout.createSequentialGroup()                        .addGap(106, 106, 106)                        .addComponent(lujing, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                        .addComponent(jButton1)))                .addGap(55, 55, 55))        );        layout.setVerticalGroup(            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(layout.createSequentialGroup()                .addGap(41, 41, 41)                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)                .addGap(32, 32, 32)                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jLabel2)                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                .addGap(34, 34, 34)                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)                    .addComponent(lujing, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)                    .addComponent(jButton1))                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 46, Short.MAX_VALUE)                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)                    .addComponent(jButton2)                    .addComponent(jButton4)                    .addComponent(jButton3))                .addGap(35, 35, 35))        );        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();        setBounds((screenSize.width-408)/2, (screenSize.height-333)/2, 408, 333);    }// </editor-fold>//GEN-END:initComponentsprivate void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed// TODO add your handling code here:    JFileChooser chooser=new JFileChooser();      int state=chooser.showOpenDialog(null);      File file=chooser.getSelectedFile();}//GEN-LAST:event_jButton1ActionPerformedprivate void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed// TODO add your handling code here:}//GEN-LAST:event_jTextField1ActionPerformedprivate void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed// TODO add your handling code here:    主界面 ac=new 主界面();     ac.setVisible(true);     this.setVisible(false);}//GEN-LAST:event_jButton3ActionPerformedprivate void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed// TODO add your handling code here:    System.exit(this.HIDE_ON_CLOSE);}//GEN-LAST:event_jButton4ActionPerformed    /**    * @param args the command line arguments    */    public static void main(String args[]) {        java.awt.EventQueue.invokeLater(new Runnable() {            public void run() {                new 文件解密().setVisible(true);            }        });    }    // Variables declaration - do not modify//GEN-BEGIN:variables    private javax.swing.JButton jButton1;    private javax.swing.JButton jButton2;    private javax.swing.JButton jButton3;    private javax.swing.JButton jButton4;    private javax.swing.JLabel jLabel1;    private javax.swing.JLabel jLabel2;    private javax.swing.JTextField jTextField1;    private javax.swing.JLabel lujing;    // End of variables declaration//GEN-END:variables}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -