java 高手 swing 界面读取文件
//下面是d:/1.txt中的文件内容"黄平",23,"女",read"马苏川",23,"男",read"马宝珠",23,"男",read"张天秀",23,"男",rea...
//下面是d:/1.txt中的文件内容
"黄平",23,"女",read
"马苏川",23,"男",read
"马宝珠",23,"男",read
"张天秀",23,"男",read
"蔡飞",23,"男",read
"刘少辉",23,"男",read
"韦自合",23,"男",read
"张冉",23,"男",read 展开
"黄平",23,"女",read
"马苏川",23,"男",read
"马宝珠",23,"男",read
"张天秀",23,"男",read
"蔡飞",23,"男",read
"刘少辉",23,"男",read
"韦自合",23,"男",read
"张冉",23,"男",read 展开
2个回答
展开全部
java.io.BufferedReader reader=new java.io.BufferedReader(new java.io.FileReader("d:\\1.txt"));
String line=reader.readLine();
这时line是 “"黄平",23,"女",read”
String array[]=line.split(",");
这时
array[0]="\"黄平\"";
array[1]="23";
array[2]="\"女\"";
array[3]="read";
剩下的自己做,写界面是个麻烦事
String line=reader.readLine();
这时line是 “"黄平",23,"女",read”
String array[]=line.split(",");
这时
array[0]="\"黄平\"";
array[1]="23";
array[2]="\"女\"";
array[3]="read";
剩下的自己做,写界面是个麻烦事
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询