java ѹËõÓë½âѹ
½üÀ´ÔÚ×öJAVAʱÓõ½ÎļþµÄѹËõÓë½âѹ,ÆäÖÐÅöµ½Á˸öÎÊÌâ:ÏÈÓÃJAVA´úÂë´ò°üºÃµÄJARÎļþ¾¹ýC#µÄzlib´¦Àíºó,¾¹È»²»ÄÜÐÞ¸Ä!
ÍøÉÏÕÒÁ˺ÃЩ´úÂ붼²»¿ÉÐÐ,JAVA´´½¨µÄJAR°üÔÚÐ޸ĵÄʱºò¿ÉÒÔ·¢ÏÖ¿ªÊ¼Óиö·¾¶·û'/'»ò'\',ËäÈ»ÔÚ´Ë¿ÉÒÔÐÞ¸ÄJARÎļþ,µ«ÊÇ×ܾõµÃÒþ»¼³öÔÚÕâ,ºóÀ´µÄÊÂʵҲ֤Ã÷ÁËÕâµã.²»¹ý»¹ºÃ,ºóÀ´ÕÒµ½Á˸ö²»´íµÄ´úÂë,±ÜÃâÁË´ËÏÖÏóµÄ·¢Éú.ÌùÉÏ´úÂë.
import java.io.*;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.*;
public class Zip {
/**
* ѹËõÎļþ¼Ð
* @param baseDir ´ýѹËõĿ¼
* @param output ѹËõÎļþÃû
*/
public static void CreateZip(String baseDir, String output) {
ZipOutputStream zos = null;
try {
List fileList = getSubFiles(new File(baseDir));
zos = new ZipOutputStream(new FileOutputStream(output));
ZipEntry ze = null;
byte[] buf = new byte[1024];
int readLen = 0;
for (int i = 0; i < fileList.size(); i++) {
File f = (File) fileList.get(i);
//´´½¨Ò»¸öZipEntry£¬²¢ÉèÖÃNameºÍÆäËüµÄһЩÊôÐÔ
ze = new ZipEntry(getAbsFileName(baseDir, f));
ze.setSize(f.length());
ze.setTime(f.lastModified());
//½«ZipEntry¼Óµ½zosÖУ¬ÔÙдÈëʵ¼ÊµÄÎļþÄÚÈÝ
zos.putNextEntry(ze);
InputStream is = new BufferedInputStream(new FileInputStream(f));
while ((readLen = is.read(buf, 0, 1024)) != -1) {
zos.write(buf, 0, readLen);
}
is.close();
}
zos.close();
} catch (Exception ex) {
Logger.getLogger(Zip.class.getName()).log(Level.SEVERE, null, ex);
} finally {
try {
zos.close();
} catch (IOException ex) {
Logger.getLogger(Zip.class.getName()).log(Level.SEVERE, null, ex);
}
Ïà¹ØÎĵµ£º
Ò»¡¢IOÁ÷µÄÈýÖÖ·ÖÀ෽ʽ
1.°´Á÷µÄ·½Ïò·ÖΪ£ºÊäÈëÁ÷ºÍÊä³öÁ÷
2.°´Á÷µÄÊý¾Ýµ¥Î»²»Í¬·ÖΪ£º×Ö½ÚÁ÷ºÍ×Ö·ûÁ÷
3.°´Á÷µÄ¹¦Äܲ»Í¬·ÖΪ£º½ÚµãÁ÷ºÍ´¦ÀíÁ÷
¶þ¡¢IOÁ÷µÄËÄ´ó³éÏóÀࣺ
×Ö·ûÁ÷£ºReader Writer
& ......
¿ÉÒÔ°ÑÆÕͨµÄJava³ÌÐò×ö³ÉÕæÕýµÄexe,Ò²¾ÍÊǵ¥Ò»¸öexe¾Í¿ÉÒÔÔÚûÓа²×°JVMµÄ»úÆ÷ÉÏÔËÐС£ÕâÑùµÄ¹¤¾ß³£¼ûµÄÓÐJETºÍgcj.Ç°ÕßÊÇÊշѵģ¬¶øÇÒ×ö³öÀ´µÄexe»¹ÊÇÐèÒªÒ»¶Ñdll¡£ÍƼöʹÓÃgcj.ËûÓÐwindowsºÍLinux°æ£¬Ö±½ÓÏÂÔØzip°ü£¬²»ÐèÒª°²×°£¬ÀïÃæÓв»ÉÙÀý×Ó£¬Ò»Ð©buildµÄÅú´¦ÀíÎļþ¡£´ÓÔÀíÀ´Ëµgcj×Ô¼ºÊµÏÖÁËJVM¹æ·¶£¬Ò²¾ÍÊÇÄ ......
public class FindPrime {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int num = 100;
String s = "100ÒÔÄÚµÄËØÊý£º";
for (int i = 1; i <= num; i++) {
int count = 0;
for (int j = 1; j <= (int) Math.s ......
http://www.gotapi.com/
ÓïÑÔ£ºÓ¢Óï
¼ò½é£ºHTML,CSS,XPATH,XSL,JAVASCRIPTµÈAPIµÄ²éѯÍøÕ¾¡£
http://www.w3schools.com/
ÓïÑÔ£ºÓ¢Óï
¼ò½é£ºW3CÖƶ¨µÄ±ê×¼ÖîÈçXML,HTML,XSLµÈµÈµÄÔÚÏßѧϰ½Ì³Ì¡£
http://www.xml.org.cn/
ÓïÑÔ£ºÖÐÎÄ
¼ò½é£º¿ÉÒÔ˵ÊÇXMLµÄÖйú¹Ù·½Íø°É¡£W3C ......
repaint ¶Ô×é¼þ½øÐÐÖػ棬±ÈÈçÒ»¸öpanel£¬µ±ÄãremoveµôpanelÀïÃæµÄÒ»¸ö×é¼þʱ£¬Äã±ØÐëµ÷ÓÃrepaint·½·¨²ÅÄܶÔpanel½øÐÐÖػ棬½øÐÐˢУ¬ÄãÏëҪɾ³ýµÄ×é¼þ²ÅÄÜÔÚ½çÃæÉÏÏûʧ¡£
revalidate ¶Ô×é¼þ½øÐÐÑéÖ¤£¬±ÈÈçÒ»¸öpanel£¬µ±ÄãremoveµôpanelÀïÃæµÄÒ»¸ö×é¼þʱ£¬µ±Äãµ÷ÓÃrevalidate·½·¨ºó£¬panelµÄ²¼ ......