文本编辑器源文件(java语言)(29) } } public void pageup() { if((sc.offsety-sc.h)>=0) { sc.offsety-=sc.h; draw(getGraphics()); fr.vert.setValue(sc.offsety); } } public void scrollpaint(int x1,int x2) { sc.offsetx= x1; sc.offsety= x2; // getGraphics().translate(-x1,-x2); draw(getGraphics()); } public void setFont(Font cuf) { Ffont= cuf; //paint= true; repaint(); } public void setColor(Color col) { Bcolor= col; // paint= true; repaint(); } public void rep() { repaint(); } private void draw(Graphics g) { findtext= new String(text,0,totle); int findi= findcount; int aa= 0;//用于记录starti