You are here:   HomeJava ProgrammingSwingJProgressBar Update in Java Example
by Dinesh Thakur Category: Swing

 

import java.awt.*;

import javax.swing.*;
import java.awt.event.*;
public class JavaExampleProgressBarUpdateInJApplet extends JApplet
  {
    JProgressBar PrgsBar = new JProgressBar();
    JButton BtnPrgsBr = new JButton("Start The Progress Bar");
    public void init()
    {
        Container Cntnr = getContentPane();
        Cntnr.setLayout(new FlowLayout());
        Cntnr.add(PrgsBar);
        Cntnr.add(BtnPrgsBr);
        PrgsBar.setStringPainted(true);
        BtnPrgsBr.addActionListener(new ActionListener()
          {
                public void actionPerformed(ActionEvent e1)
                 {
                    PrgsBar.setValue(PrgsBar.getValue() + 10);
                 }
          });
      }
   }
/*<APPLET CODE=JavaExampleProgressBarUpdateInJApplet.class WIDTH=400 HEIGHT=200></APPLET>*/
JProgressBar Update in Java Example




Subscribe To Free Daily Newsletter!

Get Free News Updates Delivered Directly To Your Inbox
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to contact us.



What's New and Popular





Popular Article