public class ReadText { public static void main(String[] args) { String line = ""; try { BufferedReader br = new BufferedReader(new FileReader("D:\\test.txt")); while((line = br.readLine()) != null){ br.skip(line.length());//在此次加入你要跳过行的条件 System.out.println(line); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }}test.txt的内容是12345执行结果是135

可以通过流的形式读取到所有内容,之后在转换成元素的形式进行实现。举例:
第一種:在jbuilder中:首先你要保证Run菜单-->RunProject能顺利运行然后Wizards菜单-->NativeExecutableBuilder选中Compressthecontentsofthearchive(产生jar文件的话)Next-->Next-->选中Alwaysincludeallclassesandresources再Next-->Next-->Next选中WindowsGUI"exe"(产生EXE文件的话)-->Finish再在项目的文件列表中的NativeExecutable右击-->Make就可以了第二種:在cmd下生成jar文件abc。