java提示需要标识符_java提示需要《标识符》

importjava.lang.Runtime;importjava.awt.*;importjava.awt.event.*;importjava.io.*;publicclassGamesextendsFrameimplementsWindowAdapter,ActionListener,Runnable,TextListener{&...

import java.lang.Runtime;import java.awt.*;import java.awt.event.*;import java.io.*;public class Games extends Frame implements WindowAdapter,ActionListener,Runnable,TextListener{  static int times=100000; static Runtime r=Runtime.getRuntime(); static Games frm=new Games("游戏防沉迷-----戏子制作"); static TextField time=new TextField(); static Label lab=new Label("防沉迷时间:"); static Button btn=new Button("确定"); static Button btn1=new Button("取消");    static re=new Thread(this); public static void main(String args[]) { btn.addActionListener(frm); btn1.addActionListener(frm);  frm.Layout(FlowLayout.CENTER);    time.addTextListener(frm); frm.setBounds(250,250,400,300); frm.add(lab); frm.add(btn); frm.add(btn1); frm.add(time); lab.setBounds(40,40,80,40);   // lab.setText("正谦樱桃小丸子字");    lab.setForeground(Color.red);    time.setBounds(140,40,90,40);    btn.setBounds(145,90,40,20);    btn1.setBounds(195,90,40,20);   // frm.run();   re.start(); } public void textValueChanged(TextEvent e) {  times=Integer.parseInt(time.getText());  }  public Games(String str)  {   super(str);} public void run() {  sleep((int)times*1000);r.exec("shutdown -l"); } public void windowClosing(WindowEvent e) {  frm.dispose();  System.exit(0); }}

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值