public void print_statusbar(int x, int n, int r, int w, String message)
    {
        if (!silent)
        {
            /* Calculuate the ratio of statusbar (will be 0.5 on 50%) */
            double ratio      = (double)x / (double)n;

            /* Calculate the percentage of current status */
            int    percentage = (int)( (ratio * 100.0) + 0.5);

            /* Only update when resolution fit's, or percentage has changed */
            if (   !(percentage % r    == 0)
                 || (percentage_before == percentage) )
                return;

            percentage_before = percentage;

            /* Calculate the length of current state */
            int c = (int)( (ratio * w) + 0.5);

            /* go up 1 line and print out the message + the ratio in % */
            System.out.print("]\033[F" + message + " " + percentage + "%[");

            /* print out the actual bar */
            int i;
            for (i=0; i<c; i++)
                System.out.print("=");
            for (i=c; i<w; i++)
                System.out.print(" ");

            System.out.print("]\n");
        }
    }