Mam jeszcze jeden problem :/
Powiedzmy, że mam 6 liczb chce wyliczyć procent każdej z niej i narysować wykres.
l1 = Integer.parseInt(t1.getText());
l2 = Integer.parseInt(t2.getText());
l3 = Integer.parseInt(t3.getText());
l4 = Integer.parseInt(t4.getText());
l5 = Integer.parseInt(t5.getText());
l6 = Integer.parseInt(t6.getText());
suma = (l1+l2+l3+l4+l5+l6);
prc1 = ((l1/suma)*100);
prc2 = ((l2/suma)*100);
prc3 = ((l3/suma)*100);
prc4 = ((l4/suma)*100);
prc5 = ((l5/suma)*100);
prc6 = ((l6/suma)*100);
Obliczenia te muszę robić na double, ponieważ gdy zrobię na int nie przelicza (w większości przypadków wychodzą liczby wymierne),
a gdy zrobię na double i dobrze wylicza procenty to nie rysuje wykresu ponieważ we współrzędnych musi być int.
g.drawImage(s1, 466, 550, 41, -(prc1*2), this);
g.drawImage(s2, 528, 550, 41, -(prc2*2), this);