zoukankan      html  css  js  c++  java
  • 使用Java高速实现进度条

    基于有人问到如何做进度条,以下给个简单的做法:

    主要是使用JProgressBar(Swing内置javax.swing.JProgressBar)和SwingWorker(Swing内置javax.swing.SwingWorker)

    有人肯定会说,不是用线程做的吗?使用线程共享一个变量,确实能够。只是这样的方式不太优雅,当然,你能够再用线程封装也行。只是,SwingWorker已经帮我们封装好啦~~使用现成的东西来做还是方便^_^

    先看效果:

    以下看代码:非常easy,相信各位大大肯定是懂的~

    该程序的可执行源代码、资源图片的下载地址:http://download.csdn.net/source/3245370

    NOTE:解压后双击里面的:CompileAndRun.bat可在Win下直接执行

  • 相关阅读:
    [Drupal] .htaccess issue
    [Drupal] 404 page didn't render other blocks.
    [Drupal] How to add the catcha to the webform
    [Javascript] Javascript如何定义函数参数的默认值
    [MySQL] #1153 Got a packet bigger than 'max_allowed_packet' bytes
    [Drupal] How to change the content from English to language Language neutral
    [Javascript] How to enlarge and small the font
    [Drupal] My method of using ajax in Drupal
    [Drupal] Submit and redirect back to the modify page
    [Drupal] Creating Checkboxes, Radio Buttons, or Select Lists
  • 原文地址:https://www.cnblogs.com/mengfanrong/p/4204356.html
Copyright © 2011-2022 走看看