请问下面程序里最后一行thisrepaint();是什么意思this是哪个对象

时间:2008-06-22 06:15:24   来源:论坛整理  作者:  编辑:chinaitzhe
public void mnuOpen_actionPerformed(ActionEvent e) {
fcSelect.showOpenDialog(this);
File file;
FileReader in=null;
try{
file=new File(fcSelect.getSelectedFile().getPath());
in=new FileReader(file);
int size=(int)file.length();
char[] data=new char[size];
int chars_read=0;
while(chars_read <size){
chars_read =in.read(data,chars_read,size-chars_read);
}
txaDisplay.setText(new String(data));
}catch(Exception ie){
txaDisplay.setText(ie.getClass().getName() ":" ie.getMessage());
}
finally{try{if(in!=null)in.close();}catch(IOException ie){}}
this.repaint();
}
}
网友回复:当前对象 一般Component型
网友回复:this是当前类生成的对象, 就是mnuOpen_actionPerformed所属的类的对象, repaint是父类Component (不是直接父类)定义的方法
关键字:请问,下面,程序,最后,一行,thisrepaint,

文章评论

共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面