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

yuyistar 2008-04-10 11:04:13
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();
}
}
...全文
450 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
despider 2008-04-10
  • 打赏
  • 举报
回复
this是当前类生成的对象, 就是mnuOpen_actionPerformed所属的类的对象, repaint是父类Component (不是直接父类)定义的方法
dracularking 2008-04-10
  • 打赏
  • 举报
回复
当前对象 一般Component型

62,623

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧