• 大小: 34KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-07
  • 语言: Java
  • 标签:

资源简介

用java实现的资源管理器 详情请移步http://blog.csdn.net/jiaxingzheng/article/details/44264433

资源截图

代码片段和文件信息

package OperatingSyetem;

import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Image;
import java.awt.Point;
import java.awt.Toolkit;

import javax.swing.Jframe;
import javax.swing.DefaultListSelectionModel;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JMenu;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import java.awt.datatransfer.*;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import java.awt.dnd.DragGestureRecognizer;
import java.awt.dnd.DragSource;
import java.awt.dnd.DragSourceDragEvent;
import java.awt.dnd.DragSourceDropEvent;
import java.awt.dnd.DragSourceEvent;
import java.awt.dnd.DragSourceListener;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.JSplitPane;
import javax.swing.JTree;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.filechooser.FileSystemView;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import com.sun.org.apache.xml.internal.utils.StringVector;

public class FileSystemUI {

private Jframe frame;
private JTree tree;
private JTable table;
private JPopupMenu tablePopupMenu;
private JPopupMenu popupMenu;
private String nameOfFileToCopy;
private String pathOfFileToCopy;
private String nameOfFileToMove;
private String pathOfFileToMove;
private Icon draggedIcon;
private JScrollPane scrollTablePane;
private JScrollPane scrollTreePane;

/**
 * Launch the application.
 */
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
FileSystemUI window = new FileSystemUI();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
 * Create the application.
 */
public FileSystemUI() {
initialize();
}

/**
 * Initialize the contents of the frame.
 */
private void initialize() {
frame = new Jframe();
frame.setBound

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-03-14 20:45  FileSystem\
     文件         226  2014-12-29 14:45  FileSystem\.classpath
     文件         386  2014-12-26 10:50  FileSystem\.project
     目录           0  2015-03-14 20:53  FileSystem\.settings\
     文件          57  2015-03-14 20:53  FileSystem\.settings\org.eclipse.core.resources.prefs
     文件         603  2014-12-26 10:52  FileSystem\.settings\org.eclipse.jdt.core.prefs
     文件        9732  2014-12-27 16:43  FileSystem\addFile.png
     文件       12275  2014-12-27 15:03  FileSystem\addFolder.png
     目录           0  2015-03-14 22:29  FileSystem\bin\
     文件        2650  2014-12-27 15:02  FileSystem\closedFolder.png
     文件        1825  2014-12-26 15:54  FileSystem\computer.png
     文件        4570  2014-12-27 15:04  FileSystem\emptyFolder.png
     文件        5742  2014-12-27 15:02  FileSystem\openedFolder.png
     目录           0  2015-03-14 20:45  FileSystem\src\
     目录           0  2015-03-14 20:45  FileSystem\src\OperatingSyetem\
     文件       20332  2015-03-14 22:14  FileSystem\src\OperatingSyetem\FileSystemUI.java

评论

共有 条评论

相关资源