当前位置:首页>开发>正文

Java语句延时

2023-04-30 02:50:15 互联网 未知 开发

 Java语句延时

Java语句延时


import java.awt.*
import java.awt.event.*
class ddd extends Frame //implements ActionListener
{

TextArea text
ddd()
{
setLayout(new FlowLayout())
text=new TextArea(12,22)
add(text)
setBounds(12,12,200,100)
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent q)
{
System.exit(0)
}
})

setVisible(true)
validate()
pack()
for(int i=0i<=100i )
{
text.append("" i " " " ")
try
{
Thread.sleep(100)
}
catch(InterruptedException e)
{

}
}

}

}
public class klkl
{
public static void main(String args[])
{
new ddd()
}
}