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

Java 操作文本 封装类

package com.sidi.card.util;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
 * 用于对文本的操作
 *
 * @author 朱志杰
 *
 */
public class NoteOperate {
    // txt文件路径
    private String filePath;
    /**
     * 构造函数
     *
     * @param filePath
     *            文本文件全路径
     */
    public NoteOperate(String filePath) {
        this.filePath = filePath;
    }
    /**
     * 构造函数
     *
     * @param file
     *            需要读取的文本文件
     */
    public NoteOperate(File file) {
        this.filePath = file.getPath();
    }
    /**
     * 判断文本文件是否存在
     *
     * @return 存在返回true 否则返回false
     */
    public boolean exists() {
        File file = new File(this.filePath);
        return file.exists();
    }
    /**
     * 得到这个txt所有的列的数据 空行将自动跳过,并自动删除文字前后的空格
     *
     * @return List<String>
     * @throws IOException
     */
    public List<String&g


相关文档:

java中hashcode()和equals()的详解

转帖自 http://www.javaeye.com/topic/257191
java中hashcode()和equals()的详解
1. 首先equals()和hashcode()这两个方法都是从object类中继承过来的。
equals()方法在object类中定义如下:
  public boolean equals(Object obj) {
return (this == obj);
}
很明显是对两个对象的地址值进行的比较(即比较 ......

Java代码重复使用

 首先在公共类写好数据库连接和关闭方法:
public static Connection getConnection(){
Connection conn = null;
try {
Context ic = new InitialContext();
DataSource source = (DataSource)ic.lookup("java:comp/env/jdbc/ownHome");
conn = source.getConnection();
} catch (NamingExcepti ......

java调用cmd命令 && 调用jar包内的properties文件

1.java调用cmd命令:
Runtime.getRuntime().exec("taskkill /f /im firefox.exe");
2.使用了loadProp()方法调用jar包内的properties文件
使用java程序监控geneFTP服务器(使用windows计划任务执行jar包),代码如下:(工程目录结构见附件)
Task.java:
package com.monitor;
import java.io.BufferedReader;
import java ......

Java适配器

ParserAdapter,MouseInputAdapter....
interface can be added to an existing class or used to create an adapter
方法就是 面向结构语言的:函数
java中适配器的作用实际上是实现了接口的类,但是适配器所实现的只是空方法。因为如果我们不用适配器,直接去实现接口,也要逐个实现里面的方法,并且大多情况下我们 ......

java 读取excel 文件

2010-03-18
package javaEcsl;
import java.io.*;
import java.util.*;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
/** */
/**
* <p>
* Title:
* </p>
* <div>Description: Excel数据导入到oracle数据库类. </div>
* <p>
* Copyright: Copyright (c) 200 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号