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

📄 filedownload.java

📁 java 多线程文件下载器源代码......
💻 JAVA
字号:
package com.sam.net.download;

import java.awt.*;
import java.awt.event.*;

import javax.swing.*;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.*;
import java.util.*;
import java.util.concurrent.ExecutionException;

import javax.swing.JPopupMenu;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;

import com.jeans.trayicon.TrayIconException;
import com.jeans.trayicon.WindowsTrayIcon;
import com.sam.gui.Login;

public class FileDownload extends JFrame implements Observer{
	URL url= null;
	String filename;
	String saveAs;
	Image iconmain = null;
	private WindowsTrayIcon icon;
    private Search selectedSource;
    private boolean clearing;
    Download download = null;
    
	private  javax.swing.JButton jbnew;
	private  javax.swing.JButton jbstart;
	private  javax.swing.JButton jbstop;
	private  javax.swing.JButton jbdele;
	private  javax.swing.JButton jbopen;
	private  javax.swing.JButton jblist;
	private  javax.swing.JButton jbset;
	private  javax.swing.JButton jbsearch;
	private javax.swing.JComboBox jComboBox1;
	private javax.swing.JDialog jDialog1;
	private javax.swing.JMenu jMenu2;
	private javax.swing.JMenu jMenu3;
	private javax.swing.JMenu jMenu4;
	private javax.swing.JMenu jMenu5;
	private javax.swing.JMenuBar jMenuBar2;
	private javax.swing.JMenuBar jMenuBar3;
	private javax.swing.JMenuBar jMenuBar4;
	private javax.swing.JMenuBar jMenuBar5;
	private javax.swing.JScrollPane jScrollPane2;
	private javax.swing.JScrollPane jScrollPane3;
	private javax.swing.JScrollPane jScrollPane4;
	public static javax.swing.JTextField searchText;
    
    DownloadTable downloadtable=new DownloadTable();
    final JTable jTable = new JTable(downloadtable);
    JMenuBar menubar = new JMenuBar();
    JPopupMenu tablepopup = new JPopupMenu();
    JLabel jLabel = new JLabel();
    JTextArea info = new JTextArea();
    ImageIcon icon1 = new ImageIcon(getClass().getResource("images/ad.jpg"));
    SuspendedPanel sp = null;
    
    
	public FileDownload() {
		initComponents();
		try {
		UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceOfficeSilver2007LookAndFeel");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (UnsupportedLookAndFeelException e) {
			e.printStackTrace();
		}
	}
	
	public void setIcon(WindowsTrayIcon icon) {
        this.icon = icon;
    }
	
	protected void processWindowEvent(WindowEvent e) {
        if (e.getID() == WindowEvent.WINDOW_CLOSING) {
            icon.setVisible(true);
            this.setVisible(false);
            try {
                icon.showBalloon(" ", "文件下载\nVersion1.0

⌨️ 快捷键说明

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