ptbar._java


// Manage Progressbar

Color 		 	pb_color  = Color.gray;		// Color of progressbar
int				pb_x=-1, 
				pb_y=-1, 
				pb_width=-1, 
				pb_height=10;	// Position and size of progressbar
int				percent[] = null;					// Indicates download progress


void pb_reset(){
	percent[0] = 0;
}

void pb_init(){
	percent = new int[1];
	percent[0] = 0;
}


void pb_draw( Graphics g, int w, int h){
	if(pb_x == -1) pb_x = w/4;
	if(pb_y == -1) pb_y = h*3/4;
	if(pb_width == -1) pb_width = w/2;
	int pc = 0;
	if(percent!=null)
		pc = percent[0];
	g.setColor(pb_color);
	g.fillRect(pb_x, pb_y, pb_width * pc / 100, pb_height);
}
				

Back