public void frame_windowclose_windowClosing(WindowListener e){
this.close();
}
/////////////////////////////////////////////////////////
public void text_mouseClicked(MouseEvent e){
if(e.getModifiers()==InputEvent.BUTTON3_MASK){
pop.show((Component)e.getSource(),e.getX(),e.getY());
}
}
public void text_ancestorAdded(AncestorEvent e){
this.dirty=false;
this.newtext();
}
public void text_caretUpdate(CaretEvent e)
{
this.dirty=true;
//this.statubar.setText(this.text.getText());
}
///////////// File /////////////////////////////////////
public void File_open_actionPerformed(ActionEvent e){
//打開的事件
this.opentext();
}
public void File_new_actionPerformed(ActionEvent e){
///新建的事件
this.newtext();
}
public void File_save_actionPerformed(ActionEvent e){
//保存的事件
this.save();
}
public void File_saveas_actionPerformed(ActionEvent e){
//另存為
this.saveas();
}
public void File_quite_actionPerformed(ActionEvent e){
this.close();
}
////////////////// Edit /////////////////////////////////////
public void Edit_undo_actionPerformed(ActionEvent e){
//撤銷
this.undo();
}
public void Edit_cut_actionPerformed(ActionEvent e){
//剪切
this.cut();
}
public void Edit_copy_actionPerformed(ActionEvent e){
//復制
this.copy();
}
public void Edit_paste_actionPerformed(ActionEvent e){
//粘貼
this.paste();
}
public void Edit_delete_actionPerformed(ActionEvent e){
//刪除
this.delete();
}
public void Edit_find_actionPerformed(ActionEvent e){
//查找
int cu=this.text.getCaretPosition();
int end=this.text.getText().length();
FindDlg fd=new FindDlg(frame,"查找",true);
fd.show();
String str=fd.getFindStr().trim();
if(fd.getFlag()){
this.nextFindStr(str,cu,end);
}else{
this.upFindStr(str,cu);
}
}
public void Edit_replace_actionPerformed(ActionEvent e){
//替換
int cu=this.text.getCaretPosition();
int end=this.text.getText().length();
ReplaceDlg rd=new ReplaceDlg(frame,"替換",true);
rd.show();
this.replaceStr(rd.findStr().trim(),rd.replaceStr().trim(),cu,end);
}
public void Edit_selectall_actionPerformed(ActionEvent e){
//全選
this.text.setSelectionStart(0);
this.text.setSelectionEnd(this.text.getText().length());
}
public void Edit_timedate_actionPerformed(ActionEvent e){
//時間日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
this.text.append("
當前