怎样判断文本区域中的内容是否更改

blueball 2003-06-16 10:05:15
做一个文本编辑器,请问怎样判断文本区域中的内容是否更改(从而可以要求用户对其保存)?
...全文
71 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
F1in2003 2003-06-16
  • 打赏
  • 举报
回复
public interface DocumentListener extends EventListener {

/**
* Gives notification that there was an insert into the document. The
* range given by the DocumentEvent bounds the freshly inserted region.
*
* @param e the document event
*/
public void insertUpdate(DocumentEvent e);

/**
* Gives notification that a portion of the document has been
* removed. The range is given in terms of what the view last
* saw (that is, before updating sticky positions).
*
* @param e the document event
*/
public void removeUpdate(DocumentEvent e);

/**
* Gives notification that an attribute or set of attributes changed.
*
* @param e the document event
*/
public void changedUpdate(DocumentEvent e);
}
mymoto 2003-06-16
  • 打赏
  • 举报
回复
/**
* textÎĵµ¼àÌý
*/
class MyDocumentListener implements DocumentListener{
public void changedUpdate(DocumentEvent e){
}

public void insertUpdate(DocumentEvent e){
}
public void removeUpdate(DocumentEvent e){
}
}
sunni 2003-06-16
  • 打赏
  • 举报
回复
点火!

62,615

社区成员

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

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