日期:2014-05-20 浏览次数:21119 次
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import javax.swing.JPanel; //显示好友伸缩界面的实现 public class Stretch extends JPanel{ private int FreindGroupNumber;//好友分组数目 private String[] FreindGroupName;//好友分组组名 private int[] FreindTotal;//各分组好友总数 private int[] FrindOnline;//当前在线好友数目 private File file; private BufferedReader br; public Stretch(String str) { //str代表号码 file=new File(str+"/Data.txt");//Data.txt记录一些信息 try { br=new BufferedReader(new FileReader(file),10); while(br.readLine()!=null) { System.out.println(br.readLine()); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void main(String[] args) { new Stretch("549271072"); } }