[原创]代码范例:自定义组件与自定义事件
自定义事件: 【程序编程相关:ASP.NET中不定级动态菜单的实现(附】
【推荐阅读:asp记录日志程序】 * @(#) odtbuttonevent.java 【扩展信息:很强的flash游戏】/** * * copyright 2004 opensource develop team. all rights reserved. */// package
package com.opensource.event;// import classes
import java.awt.awtevent;/**
* 自定义按钮事件. * * @author odt * @version 1.0 06/05/2004 * @see awtevent * @since jdk 1.3 */public class odtbuttonevent extends awtevent{ public static final int entered = 1; // 鼠标进入button public static final int exited = 2; // 鼠标退出button public static final int pressed = 3; // 鼠标按下 public static final int released = 4; // 鼠标释放object item;
int buttonstate;public odtbuttonevent(odtbuttonable source, object item, int buttonstate)
{ super(source, -1); this.item = item; this.buttonstate = buttonstate; }public odtbuttonable getodtbuttonable()
{ return (odtbuttonable) source; // 返回被监听的对象 }public object getitem()
{ return item; }public int getbuttonstate()
{ return buttonstate; // 返回按钮状态 }... 下一页