fillcolorevent.java
来自「程序练习中包括书中实例程序代码和练习中要用到的代码,是压缩文件」· Java 代码 · 共 34 行
JAVA
34 行
package examples.beans;
import java.awt.Color;
import java.util.EventObject;
/** A user-defined event class
*/
public class FillColorEvent extends EventObject {
/** event type identifier */
public static final int COLOR_CHANGE = 0;
private int id;
private Color color;
/** Construct an event object
* @param source the object initiating the event
* @param id the event identifier
* @param c the color for the event
*/
public FillColorEvent( Object source, int id,
Color c ) {
super( source );
id = id;
color = c;
}
/** Return the color associated with the event
* @return The color
*/
public Color getColor() {
return color;
}
/** Return the event identifier
* @return The event identifier
*/
public int getID() {
return id;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?