最近用swing写了一个客户端工具(以jar的方式),下面是写的jar自动更新程序。
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.swing.JOptionPane;
public class AutoUpdateThread extends Thread {
private String filename = "test.jar";
private static String xiheportalURL = "http://localhost:8080/test/testJarAction";
public static void main(String[] arg) {
try {
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void run() {
UpdateJFrame uj = null;
String message = null;
String title &#