Topic: 怎么才能显示出时间呀

  Print this page

1.怎么才能显示出时间呀 Copy to clipboard
Posted by: flywithmoon
Posted on: 2004-08-27 16:45

调试可以通过,但运行不显示时间,帮忙看看吧
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.applet.*;

public class mytest extends JApplet implements Runnable
{
  String s;
  Date d;
  JTextField jt=new JTextField();
public void init()
{
  Thread t=new Thread();
  this.getContentPane().add(jt);
  t.start();
}
public void run()
{
  while(true)
  {
    try
    {
      jt.setText(d.toString());
      Thread.sleep(1000);
      //repaint();
      }catch(Exception e){e.printStackTrace();}
    }
  }
}

2.Re:怎么才能显示出时间呀 [Re: flywithmoon] Copy to clipboard
Posted by: Julian13
Posted on: 2004-08-27 17:26

seem the "d" haven't been created.


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923