使用from 的setTimeOut方法实现定时关闭Form /**** 功能描述: 1)首先在Form中增加一个CommandButton选择“确定”或者“取消”命令按钮 2)然后在Form中的Method中增加一个getData()方法来关闭Form窗体 3)最后重载Form中的Method下的Run()方法,设定定时器!来调用getData()达到定时关闭Form的效果! 在From 下的method下编辑以下代码: getdata方法是实现关闭Form,cmdOK是一个关闭按钮. */ public void getData() { cmdok.clicked();//同 this.close(),方法功能一样; } //在运行时设置溢出时间为1000秒 public void run() { super(); this.setTimeOut('getdata',1000,true); }