Show user that program still. Running

I wrote a Java program that reads a file, process the numbers and then output result to to the user. The processing could take a while so I would like to display some sort of progress bar or just simply thinking glass (anything reallly) that indicate to the user that the program is actually processing something.

Any recommendation for quick Solution for it?

Thank you

Answers


Display a busy cursor:

try {
  component.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  // process
} finally {
 component.setCursor(Cursor.getDefaultCursor());
}

This might help you...

Command line progressbar

http://nakkaya.com/2009/11/08/command-line-progress-bar/

public static void printProgBar(int percent){
    StringBuilder bar = new StringBuilder("[");

    for(int i = 0; i < 50; i++){
        if( i < (percent/2)){
            bar.append("=");
        }else if( i == (percent/2)){
            bar.append(">");
        }else{
            bar.append(" ");
        }
    }

    bar.append("]   " + percent + "%     ");
    System.out.print("\r" + bar.toString());
}

Need Your Help

Building an Instapaper clone

c# html text data-mining

I'm currently building a Instapaper clone and need some help designing the algorithm.

Interoperability of AES CTR mode?

cryptography aes commoncrypto ctr-mode

I use AES128 crypto in CTR mode for encryption, implemented for different clients (Android/Java and iOS/ObjC). The 16 byte IV used when encrypting a packet is formated like this:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.