当前位置: 技术问答>java相关
如何能在java重实现时间监视,定时运行
来源: 互联网 发布时间:2015-03-30
本文导语: | import java.awt.*; import javax.swing.*; import java.awt.event.*; import javax.swing.Timer.*; public class Test extends JPanel{ ActionListener myAL; Timer MyTimer; int internal=1000; //你要的时间间隔 int myout=0; int m=1; int d=0;...
|
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.Timer.*;
public class Test extends JPanel{
ActionListener myAL;
Timer MyTimer;
int internal=1000; //你要的时间间隔
int myout=0;
int m=1;
int d=0;
Container panel=this;
JPanel panel1=new JPanel(new BorderLayout());
JLabel label=new JLabel();
public Test(){
add(panel1);
panel1.add(label);
myAL=new ActionListener(){
public void actionPerformed(ActionEvent e){
MyTimer.stop();
if(myout
import javax.swing.*;
import java.awt.event.*;
import javax.swing.Timer.*;
public class Test extends JPanel{
ActionListener myAL;
Timer MyTimer;
int internal=1000; //你要的时间间隔
int myout=0;
int m=1;
int d=0;
Container panel=this;
JPanel panel1=new JPanel(new BorderLayout());
JLabel label=new JLabel();
public Test(){
add(panel1);
panel1.add(label);
myAL=new ActionListener(){
public void actionPerformed(ActionEvent e){
MyTimer.stop();
if(myout