⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scrollpanel.java

📁 和YACC一样
💻 JAVA
字号:
/*File:	 ScrollPanel.javaAuthor:  zerksis d. umrigar (zdu@acm.org)Copyright (C) 1997 Zerksis D. UmrigarLast Update Time-stamp: "97/07/19 19:40:57 zdu"This code is distributed under the terms of the GNU General Public License.See the file COPYING with this distribution, or		http://www.fsf.org/copyleft/gpl.htmlTHERE IS ABSOLUTELY NO WARRANTY FOR THIS PROGRAM.*/package zdu.zydebug;import java.awt.*;/** A panel containing a canvas, a south and east scrollbars. * This class is necessary solely to handle scroll events.  */class ScrollPanel extends Panel {  ScrollPanel(Canvas canvas, Scrollbar hScroll, Scrollbar vScroll) {    this.canvas= canvas; this.hScroll= hScroll; this.vScroll= vScroll;    setLayout(new BorderLayout());    add("South", hScroll); add("East", vScroll);    add("Center", canvas);   }  public boolean handleEvent(Event event) {    if (event.target == hScroll || event.target == vScroll) {      canvas.repaint();    }    return super.handleEvent(event);  }  private Canvas canvas;  private Scrollbar hScroll, vScroll;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -