java小程序(实现压缩和解压.zip格式文件)

JAVA小型项目开发报告

一、 项目简介 程序可以完成生成zip格式文件和解压zip格式文件操作,并且可以指定文件的路径 二、 开发环境 Windows10,JDK1.8。 开发软件:Eclipse+NetBeans 三、 业务流程图 四、 UML类图 五、 核心算法流程图 1

六、 程序代码 package Zipdemo;//程序主界面 import static Zipdemo.Zipcode.setcenter; import java.awt.Dimension; import java.awt.Toolkit; import javax.swing.JFrame; import javax.swing.JOptionPane; public class mainZipUl extends javax.swing.JFrame { private ZipFileUl itsZipFileUl; private UnZipFileUl itsUnZipFileUl; public mainZipUl() { initComponents(); this.setTitle(\解压小程序\ setcenter(this); this.setResizable(false); } private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); 2

UnZipFile = new javax.swing.JButton(); about = new javax.swing.JButton(); ZipFile = new javax.swing.JButton(); jLabel3 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setBackground(new java.awt.Color(211, 238, 238)); jLabel1.setText(\小程序可以实现压缩和解压文件功能\ jLabel2.setText(\选择你要的功能\ UnZipFile.setText(\解压文件\ UnZipFile.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { UnZipFileActionPerformed(evt); } }); about.setText(\关于\ about.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { aboutActionPerformed(evt); } }); ZipFile.setText(\压缩文件\ ZipFile.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ZipFileActionPerformed(evt); } }); jLabel3.setText(\欢迎来到Java解压小程序主界面\ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(206, 206, 206) .addComponent(UnZipFile, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(56, 56, 56).addComponent(about, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup().addGap(138, 138, 138).addComponent( jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup().addGap(181, 181, 181).addComponent( jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 3

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4