当前位置: 技术问答>java相关
在线等待,高分求救
来源: 互联网 发布时间:2015-05-03
本文导语: 如何在进度条上显示一行汉字例如“请等待”使之从象左边逐渐走到右边?请给出程序,能运行就给分 | import java.io.*; import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; impor...
如何在进度条上显示一行汉字例如“请等待”使之从象左边逐渐走到右边?请给出程序,能运行就给分
|
import java.io.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
public class Test extends JFrame
{
public Test(String s)
{
super(s);
init();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(new Dimension(400, 300));
setVisible(true);
}
MyProgressBar bar;
javax.swing.Timer timer;
private void init()
{
bar = new MyProgressBar("$(ADc:C(B");
getContentPane().add(bar, BorderLayout.SOUTH);
timer = new javax.swing.Timer(18, createTextLoadAction());
timer.start();
}
private Action createTextLoadAction()
{
return new AbstractAction("move action")
{
public void actionPerformed (ActionEvent e)
{
if(bar.getValue()
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
public class Test extends JFrame
{
public Test(String s)
{
super(s);
init();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(new Dimension(400, 300));
setVisible(true);
}
MyProgressBar bar;
javax.swing.Timer timer;
private void init()
{
bar = new MyProgressBar("$(ADc:C(B");
getContentPane().add(bar, BorderLayout.SOUTH);
timer = new javax.swing.Timer(18, createTextLoadAction());
timer.start();
}
private Action createTextLoadAction()
{
return new AbstractAction("move action")
{
public void actionPerformed (ActionEvent e)
{
if(bar.getValue()