Indefinite progress bar Using Swing


This example creates a window which contains an indefinite progress bar. While launch the program, you see a tiny rectangle bouncing back and forth within the progress bar's bounds, The result is much better on Mac OS X because it uses the native Look and Feel automatically 
// Comment
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
packagecom.allinalljava;
importjavax.swing.*; 
/**
 *
 * @author allinalljava
 */
public class ProgressJava {


public static void main(String[] args) {
JFrame f = new JFrame("Progress");
JProgressBar p = new JProgressBar( );
p.setIndeterminate(true);
f.getContentPane( ).add(p);
f.pack( );
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
  } 
}

Output

raja P Web Developer

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...