易截截图软件、单文件、免安装、纯绿色、仅160KB

用JAVA实现了带有复选框的树目录

JDK版本
        JDK1.4.x
    功能
        实现了带有复选框的资源管理器树目录,还有需要改进的地方,我在以后更新,如果那位朋友有好的建议欢迎提出
   
    欢迎大家提意见,交流
   
    代码如下
   
import javax.swing.tree.*;
import javax.swing.filechooser.*;
import javax.swing.event.*;
import java.awt.Cursor;
import java.awt.Component;
import java.awt.Font;
import java.io.*;
import java.awt.*;
import javax.swing.*;
import java.util.*;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;
/**
 * Title: 系统级树目录
 * Description: 
 * Copyright: Copyright (c) 2004
 * Company: 
 * @author cuijiang contact cj0063@sina.com or cuij7718@yahoo.com.cn
 * @version 1.0
 */
public class AgileSuperJTreeBasic
    extends JTree
    implements TreeExpansionListener, TreeSelectionListener, MouseListener {
  protected DefaultTreeModel treeModel;
  protected FileSystemView fileSystemView; //建立文件系统视类对象
  protected FileNode root;
  public AgileSuperJTreeBasic() {
    Font myFont = new Font("宋体", 11, 12);
    fileSystemView = FileSystemView.getFileSystemView();
    root = new FileNode(fileSystemView.getRoots()[0]);
    root.explore();
    treeModel = new DefaultTreeModel(root);
    this.setModel(treeModel); //设定树形菜单
    this.addTreeExpansionListener(this); //打开/关闭节点事件
    this.addTreeSelectionListener(this); //选择的事件
    this.setCellRenderer(new MyTreeCellRenderer()); //生成图标
    this.setFont(myFont);
    this.setRootVisible(true);
    this.setRowHeight(18);
 


相关文档:

java 调用命令 备份mysql数据库

 代码如下:
  1  String command  =   " cmd /c C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqldump -h localhost -u root -p aijia > E:/aijia.dmp " ;
  2      try    {
  3     Process process& ......

java解析properties的方法

1。使用java.util.Properties类的load()方法
示例: InputStream in = lnew BufferedInputStream(new FileInputStream(name));
Properties p = new Properties();
p.load(in);
2。使用java.util.ResourceBundle类的getBundle()方法
示例: ResourceBundle rb = ResourceBundle.getBundle(name, Locale.getDefault()); ......

从C到JAVA,开始我的IT菜鸟之路!

真正发现人生需要知识的时候,我的青春已经浪费了一半。
于是鼓起勇气来到北大青鸟学习IT,鉴于多方考虑,还是选择了软件测试。
如今课业的一大半也已结束,从刚开始的一无所知,渐渐成长为一个菜鸟……
在课程的学习过程中,才渐渐发现自己对于这个行业的兴趣,尤其是软件开发这一块。
甚至对自己选择做测 ......

我的第一个FreeMarker模板生成java代码的例子

第一步.新建一个模板文件以.ftl结尾。
IDAO.ftl
 package com.media.dao;
import java.util.List;
import com.media.bean.${model_name};
import com.media.exceptions.DAOException;
/**
* ${model_name_cn}接口
*
* @author ${author}
* @link ${link}
*
* @version $Revision: 1.00 $ $Date: ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号