Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

help System.out.flush() doesn't work

807607Dec 7 2006 — edited Dec 7 2006
Hi all, I'm trying to create an "advancing bar" (don't know how to translate it) for one of my program, and i'd like just to print a character '.' in a line.
The problem is that system.out.flush() doesn't do anything until a new println is called.Why?
boolean[] barra={false,false,false,false,false,false,false,false,false,false,false};


public void barra(int x){
 
     if (!Log){
            if ((x!=0)&&(x%10==0)){
                if (barra[x/10]==false)    {
                    System.out.print("...running... "+x+"% completed");
                    System.out.flush();                                                                      //doesn't work
                }
                barra[x/10]=true;
                            //System.out.flush();
            }
        }
    }
Does someone knows how to solve it?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 4 2007
Added on Dec 7 2006
11 comments
1,217 views