Progress Bar

Progress Bar

View Answers

September 18, 2009 at 11:36 AM

Hi Friend,

Try the following code:

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

class ProgressTest extends JFrame {
Timer timer;
final static int interval = 1000;
JProgressBar pb = new JProgressBar();
JButton progress1 = new JButton("Progress1");
JButton progress2 = new JButton("Progress2");
int i;
ProgressTest() {
setLayout(null);
setTitle("Progress Test");
setSize(600, 600);
pb.setBounds(100, 100, 100, 20);
progress1.setBounds(250, 100, 100, 20);
progress2.setBounds(250, 200, 100, 20);
pb.setMaximum(100);
progress1.addActionListener(new ActionListener(){
public void actionPerformed (ActionEvent event) {
pb.setValue(pb.getValue() + 10);
}
});
progress2.addActionListener(new ButtonListener());
pb.setValue(10);
add(pb);
add(progress1);
add(progress2);
timer = new Timer(interval, new ActionListener() {
public void actionPerformed (ActionEvent event) {
if (i == 100){
Toolkit.getDefaultToolkit().beep();
timer.stop();
pb.setValue(0);
}
i = i + 5;
pb.setValue(i);
}
});
}
class ButtonListener implements ActionListener {
public void actionPerformed(ActionEvent ae) {
progress2.setEnabled(false);
i = 0;
timer.start();
}
}
public static void main (String [] args) {
ProgressTest obj = new ProgressTest();
obj.setVisible(true);
obj.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}

Thanks









Related Tutorials/Questions & Answers:
Progress Bar
Progress Bar  Hi friend, I'm interested in knowing how to progress bar in oracle forms 9i for the trigger when-button-pressed.Thankyou. Thanks and Regards, M.SHANKAR
progress bar
progress bar  Hi guys, I'm doing a file upload in spring MVC technology. For file upload i did validation in client side.While uploading how to use an ajax function to show the progress bar
Advertisements
ModuleNotFoundError: No module named 'progress_bar'
ModuleNotFoundError: No module named 'progress_bar'  Hi, My Python... 'progress_bar' How to remove the ModuleNotFoundError: No module named 'progress_bar' error? Thanks   Hi, In your python
Progress Bar in Java
Progress Bar in Java       Progress Bar is a component used to show the status of the application... application. In Java Progress Bar is created using swing. The Swing Class used
Progress Bar - Swing AWT
Progress Bar  Hey if possible plz help me in making the following program work... i m using threads in order to make the progress bar auto increment..." is for manual updation of progress bar.. import java.awt.*; import javax.swing.
Progress Bar implementation in Java Script
Progress Bar implementation in Java Script  Hi Friend, I am new to Java Script, but i want implement the progress bar in my html by reading... progress bar will show the status. I hope you under stand my issue. Please do
Dojo Progress Bar
Dojo Progress Bar          In this section, you will learn about the progress bar and how to create a progress bar in dojo. Try Online: Progress BarADS_TO_REPLACE_1
ModuleNotFoundError: No module named 'c_progress_bar'
ModuleNotFoundError: No module named 'c_progress_bar'  Hi, My... named 'c_progress_bar' How to remove the ModuleNotFoundError: No module named 'c_progress_bar' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'c_progress_bar'
ModuleNotFoundError: No module named 'c_progress_bar'  Hi, My... named 'c_progress_bar' How to remove the ModuleNotFoundError: No module named 'c_progress_bar' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'pyterm-progress-bar'
ModuleNotFoundError: No module named 'pyterm-progress-bar'  Hi, My... named 'pyterm-progress-bar' How to remove the ModuleNotFoundError: No module named 'pyterm-progress-bar' error? Thanks   Hi
ModuleNotFoundError: No module named 'pyterm-progress-bar'
ModuleNotFoundError: No module named 'pyterm-progress-bar'  Hi, My... named 'pyterm-progress-bar' How to remove the ModuleNotFoundError: No module named 'pyterm-progress-bar' error? Thanks   Hi
ModuleNotFoundError: No module named 'snake_progress_bar'
ModuleNotFoundError: No module named 'snake_progress_bar'  Hi, My... named 'snake_progress_bar' How to remove the ModuleNotFoundError: No module named 'snake_progress_bar' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'text_progress_bar'
ModuleNotFoundError: No module named 'text_progress_bar'  Hi, My... named 'text_progress_bar' How to remove the ModuleNotFoundError: No module named 'text_progress_bar' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'text_progress_bar'
ModuleNotFoundError: No module named 'text_progress_bar'  Hi, My... named 'text_progress_bar' How to remove the ModuleNotFoundError: No module named 'text_progress_bar' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'console-progress-bar'
ModuleNotFoundError: No module named 'console-progress-bar'  Hi...: No module named 'console-progress-bar' How to remove the ModuleNotFoundError: No module named 'console-progress-bar' error? Thanks   Hi
ModuleNotFoundError: No module named 'c_progress_bar'
ModuleNotFoundError: No module named 'c_progress_bar'  Hi, My... named 'c_progress_bar' How to remove the ModuleNotFoundError: No module named 'c_progress_bar' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'dash-progress-bar'
ModuleNotFoundError: No module named 'dash-progress-bar'  Hi, My... named 'dash-progress-bar' How to remove the ModuleNotFoundError: No module named 'dash-progress-bar' error? Thanks   Hi, In your
Using Progress Bar in java apps
Using Progress Bar in java apps  Please, i am writing a program... write back to another file. I would like to know how to use a progress bar to mark the progress of the task.   Hi Friend, Try the following code:ADS
Progress Bar in Java Swing
Progress Bar in Java Swing       In this section, you can learn how to handle progress bar in java swing. This section shows you how the progress bar starts and stops
Version of com.chillerlabs>android-circular-progress-bar dependency
List of Version of com.chillerlabs>android-circular-progress-bar dependency
Progress Bar in Java
Progress Bar in Java       Progress Bar is a component used to show the status of the application... application. In Java Progress Bar is created using swing. The Swing Class used
Create Progress Bar in SWT
Create Progress Bar in SWT   ... Bar. SWT allows to create a Progress bar by providing the class ProgressBar... the progress in the form of bar. The method setMinimum() sets the minimum value
progress bar in google map - Development process
progress bar in google map   in my google map i want a progress bar... are loaded on the map.  Hi Nikhil, This is simple progress bar code...; private JPanel topPanel; public ProgressBarDemo(){ setTitle("Progress Bar
Maven Dependency android-circular-progress-bar >> 0.0.1
You should include the dependency code given in this page to add Maven Dependency of com.chillerlabs >> android-circular-progress-bar version0.0.1 in your project
Maven Repository/Dependency: com.chillerlabs | android-circular-progress-bar
Maven Repository/Dependency of Group ID com.chillerlabs and Artifact ID android-circular-progress-bar. Latest version of com.chillerlabs:android-circular-progress-bar dependencies. # Version Release Date
Creating custom application download progress bar
Creating custom application download progress bar  ... will know how to create a customized application download progress bar... is raised. This download progress bar would not be displayed if the SWF
Maven, Gradle, SBT, Ivy, Grape, Leiningen and Buildr Dependency for android-circular-progress-bar version 0.0.1
-circular-progress-bar version 0.0.1. You can add these depency in your project to get com.chillerlabs:android-circular-progress-bar:0.0.1 Java library in your... for android-circular-progress-bar version 0.0.1 In this section have given
Maven dependency for com.chillerlabs - android-circular-progress-bar version 0.0.1 is released. Learn to use android-circular-progress-bar version 0.0.1 in Maven based Java projects
-circular-progress-bar released The developers of   com.chillerlabs - android-circular-progress-bar project have released the latest version...-circular-progress-bar library is 0.0.1. Developer can use this version
PHP GD Progress Bar
AJAX Progress Bar for KUpload+
AJAX Progress Bar for KUpload+      ... information about the current upload, just like pure HTML progress bar but instead of popup window it uses an inline progress bar with the AJAX technology
Dojo Progress Bar
Dojo Progress Bar      ... the progress bar and how to create a progress bar in dojo. Progress Bar : The progress bar is a GUI (Graphical User Interface) that gives dynamic feedback
Dojo Progress Bar
Dojo Progress Bar      ... the progress bar and how to create a progress bar in dojo. Progress Bar : The progress bar is a GUI (Graphical User Interface) that gives dynamic feedback
Bar graph
Bar graph  How to include a bar chart in iPhone sdk
ModuleNotFoundError: No module named 'progress'
ModuleNotFoundError: No module named 'progress'  Hi, My Python... 'progress' How to remove the ModuleNotFoundError: No module named 'progress... to install padas library. You can install progress python with following
bar chart
bar chart  how to create a bar chart from values of the database and the string value should be the entities of the database??plzz help..needed badly
Version of com.droidkit>progress dependency
List of Version of com.droidkit>progress dependency
Dynamically Servlet progress
Dynamically Servlet progress   Hi all, My question is , when am running a servlet using ajax. It returning the response after servlet processing. Is there any way to get the response from the servlet after some progress. Please
Bar Chart
Bar Chart  hi...... Thanks 4 ur help for the bar graph creation i have got what i wanted. But now want to ask that in that bar graph i want multiple bar on one value means I want to create a graph where on my x-axis i have
Version of com.pnikosis>materialish-progress dependency
List of Version of com.pnikosis>materialish-progress dependency
Version of com.tasomaniac>delayed-progress dependency
List of Version of com.tasomaniac>delayed-progress dependency
ModuleNotFoundError: No module named 'alive-progress'
ModuleNotFoundError: No module named 'alive-progress'  Hi, My... named 'alive-progress' How to remove the ModuleNotFoundError: No module named 'alive-progress' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-progress'
ModuleNotFoundError: No module named 'django-progress'  Hi, My... named 'django-progress' How to remove the ModuleNotFoundError: No module named 'django-progress' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'easy-progress'
ModuleNotFoundError: No module named 'easy-progress'  Hi, My... 'easy-progress' How to remove the ModuleNotFoundError: No module named 'easy-progress' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'incremental-progress'
ModuleNotFoundError: No module named 'incremental-progress'  Hi...: No module named 'incremental-progress' How to remove the ModuleNotFoundError: No module named 'incremental-progress' error? Thanks   Hi
ModuleNotFoundError: No module named 'light-progress'
ModuleNotFoundError: No module named 'light-progress'  Hi, My... named 'light-progress' How to remove the ModuleNotFoundError: No module named 'light-progress' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'log_progress'
ModuleNotFoundError: No module named 'log_progress'  Hi, My Python... 'log_progress' How to remove the ModuleNotFoundError: No module named 'log_progress' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'progress-disp'
ModuleNotFoundError: No module named 'progress-disp'  Hi, My... 'progress-disp' How to remove the ModuleNotFoundError: No module named 'progress-disp' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'progress_meter'
ModuleNotFoundError: No module named 'progress_meter'  Hi, My... named 'progress_meter' How to remove the ModuleNotFoundError: No module named 'progress_meter' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'progress-pybar'
ModuleNotFoundError: No module named 'progress-pybar'  Hi, My... named 'progress-pybar' How to remove the ModuleNotFoundError: No module named 'progress-pybar' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'progress-rajanmandanka'
ModuleNotFoundError: No module named 'progress-rajanmandanka'  Hi...: No module named 'progress-rajanmandanka' How to remove the ModuleNotFoundError: No module named 'progress-rajanmandanka' error? Thanks   Hi

Ads