slaskPJ 20 de mai. de 2004
Eae…
rapaz, cola o codigo aki se nao for mto grande, pq as vezes pode ser algo q vc ta fazendo de errado. =P
marciocamuratiPJ 20 de mai. de 2004
public void paint(Graphics g) {
String temp_array_int_dados = getParameter ( "array_int_dados" );
String array_int_dados [] = temp_array_int_dados . split ( "," );
String temp_array_string_dados = getParameter ( "array_string_dados" );
String array_string_dados [] = temp_array_string_dados . split ( "," );
Color cores_usadas [] ;
cores_usadas = new Color [ array_int_dados.length ] ;
int tamanho_ini_x = 41 ;
int tamanho_x = tamanho_ini_x * array_int_dados . length ;
g . drawRect ( 0 , 20 , tamanho_x , 180 );
String string_titulo = getParameter ( "string_titulo" );
g . drawString ( string_titulo , 0 , 10 );
g . drawRect ( 0 , 20 , tamanho_x , 180 );
for ( int x = 0 ; x & lt ; array_int_dados . length ; x ++ ) {
int numero_cor = 0 + ( int ) ( Math . random () * 8 );
Color cores [] = { Color . red , Color . blue , Color . gray , Color . black , Color . orange , Color . yellow , Color . pink , Color . green , Color . lightGray } ;
cores_usadas [ x ] = cores [ numero_cor ] ;
g . setColor ( cores_usadas [ x ] );
int numeros = Integer . parseInt ( array_int_dados [ x ] ) / 100 ;
int resultado = numeros * 180 ;
g . drawRect ( pos_ini , 200 - Integer . parseInt ( array_int_dados [ x ] ), 20 , Integer . parseInt ( array_int_dados [ x ] ));
g . fillRect ( pos_ini , 200 - Integer . parseInt ( array_int_dados [ x ] ), 20 , Integer . parseInt ( array_int_dados [ x ] ));
pos_ini += 40 ;
}
}