当前位置: 代码迷 >> Java相关 >> 在dos 下怎么运行这个java文件?
  详细解决方案

在dos 下怎么运行这个java文件?

热度:169   发布时间:2005-05-24 11:32:00.0
在dos 下怎么运行这个java文件?

/* 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); } }

搜索更多相关的解决方案: java  dos  文件  运行  

----------------解决方案--------------------------------------------------------
没有main函数怎么运行?只是一个类罢了
----------------解决方案--------------------------------------------------------
对呀
----------------解决方案--------------------------------------------------------

设一个班有10名学生,每个学生有姓名、学号、成绩等信息,请利用向量的概念编程,求平均成绩。 大家给看看怎么做.
----------------解决方案--------------------------------------------------------

  相关解决方案