When I run this loading bar script the bar doesn't load and then it loads to the maximum. how come this load bar doesn't work thanks for the help.
// The "LoadBar" class.
import java.awt.*;
import hsa.Console;
public class LoadBar
{
static Console c; // The output console
public static void main (String[] args)
{
c = new Console ();
double load;
int loaded, total, a, loadbar;
a = 0;
total = 100;
loaded = 0;
Font loading = new Font ("Ariel", Font.BOLD, 30);
while (a == 0)
{
int i = 0;
c.clear ();
load = (loaded * 100) / total;
loadbar = (int) Math.round (load);
c.setColor (Color.green);
c.fillRect (10, 75, loadbar, 10);
c.setColor (Color.black);
c.setFont (loading);
c.drawString ("Loading", 250, 50);
for (i = 0 ; i <= 1000000000 ; i++)
loaded = loaded + 1;
}
// Place your program here. 'c' is the output console
} // main method
} // LoadBar class