資源簡介
用java對各種文件進行加密解密,該文件中附有程序所有的源代碼,并且包含大量的注釋,方便大家學習交流。

代碼片段和文件信息
package?encrypt;
import?java.awt.Color;
import?java.io.*;
import?javax.swing.filechooser.FileFilter;???
import?javax.swing.*;?
public?class?browse?extends?Jframe???????????????????
{??
?public?chooseFile?Jfc?=?new?chooseFile();????????????//建立選擇檔案對話方塊盒?Jfc
?public?JTextField?jtf;
?public?Thread?afresh;//刷新列表
?private?ImageIcon?JFIcon;
?public?void?setIcon(String?icon)
?{
?JFIcon=new?ImageIcon(browse.class.getResource(icon));
?this.setIconImage(JFIcon.getImage());
?}
?public?void?setOpen()
?{
?this.setVisible(true);
??afresh=new?Thread(new?Runnable(){
??public?void?run()
??{
??while(true)
??{
??try
??{
??afresh.sleep(2000);
??}catch(Exception?e)
??{}
??Jfc.rescanCurrentDirectory();//刷新列表
??}
??}
??});
??afresh.start();
?}
?public?void?setjtf1(JTextField?jtf)
?{
?this.jtf=jtf;
?}
?public?browse(String?title)??????
?{
?this(title“key.gif“);
?}
?public?browse(String?titleString?icon)??????
?{
?setIcon(icon);
??getContentPane().add(Jfc);
??this.settitle(title);
??this.setSize(550350);????
??//this.setVisible(true);
??//this.setDefaultCloseOperation(3);
?}
?public?class?chooseFile?extends?JFileChooser???//chooseFile?繼承?JFileChooser
?{
??File?select;
??public?void?approveSelection()????????????????//使用者按下核選按鈕
??{
???select?=?Jfc.getSelectedFile();???
????????????//取得選擇的文件
???//filename?=?Jfc.getName(select)?;?????????????//取得文件名
???jtf.setText(select.toString());
???browse.this.setVisible(false);
???afresh.interrupt();
???afresh=null;
???//JOptionPane.showMessageDialog(getContentPane()“你選擇了文件?“?+?select);
???/*?顯示信息對話框?*/
??}
??public?void?cancelSelection()?????????????????//使用者按下取消按鈕
??{
???/*?顯示信息對話框?*/
???Jfc.setSelectedFile(null);???????????????????//重設被選取的文件為?null
???browse.this.setVisible(false);
???afresh.interrupt();
???afresh=null;
??}
?}
}??
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2096??2009-12-03?13:51??encrypt(英文版)\browse.java
?????文件??????23435??2009-12-02?12:30??encrypt(英文版)\ed.java
?????文件???????6891??2009-12-03?14:06??encrypt(英文版)\encrypt.java
?????文件???????2138??2009-11-30?22:43??encrypt(英文版)\key.gif
?????文件???????3223??2009-12-03?14:06??encrypt(英文版)\open.gif
?????文件???????2868??2009-12-03?14:04??encrypt(英文版)\save.gif
?????目錄??????????0??2009-12-03?14:09??encrypt(英文版)
-----------?---------??----------?-----??----
????????????????40651????????????????????7
評論
共有 條評論