编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛  
全能 ASP / PHP / ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付学习型 ASP/PHP/ASP.NET 主机 30元/年
发新话题
打印

[讨论]这个程序怪哦!

[讨论]这个程序怪哦!

这个程序输出什么? /* tButton.java * * Tabbed Focus Classes * Copyright(C) 1996 by Bill Giel * * E-mail: rvdi@usa.nai.net * WWW: http://www.nai.net/~rvdi/home.htm * *************************************************************************** * Abstract * -------- * Overrides Button to provide action if ENTER is pressed when the * tButton object has focus. * *************************************************************************** * THE AUTHOR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE AUTHOR SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. ***************************************************************************/

import java.awt.*;

/** Overrides Button to provide action if ENTER is pressed when the * tButton object has focus. */

public class tButton extends Button { static final int ENTER = 10;

/** Construct a tButton object with the supplied label. */ tButton(String label) { super(label); }

/* Provides action by posting an ACTION_EVENT to the parent when * ENTER is pressed and the tButton object has focus. */ public boolean handleEvent(Event e) { switch(e.id){ case Event.KEY_PRESS: switch(e.key){ case ENTER: postEvent(new Event(getParent(),Event.ACTION_EVENT,getLabel())); return true; } } return super.handleEvent(e); } }

TOP

嗯,谁能回答出来啊?啊?
Not a hero until you reach The Greatwall!

TOP

没耐心看下去
我是一个新手,向各位请教 QQ:274077173 Email:lintianxiao_3891@163.com

TOP

发新话题