1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| public void paint(Graphics g) {
//tdi est un tableau à 2D en double TDI[1000][2]
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2.setColor(Color.RED);
for (int t= 1; t< compute.tdi.length/2-2; t++){ //cette boucle ne fonctionne pas !
if(compute.tdi[t-1][0]!=0.0 && compute.tdi[t-1][1]!=0.0 && compute.tdi[t][0]!=0.0 && compute.tdi[t][1]!=0.0)
g2.draw(new Line2D.Double((int)compute.tdi[t-1][0], (int)compute.tdi[t-1][1], (int)compute.tdi[t][0], (int)compute.tdi[t][1]));
}
g2.drawLine(10, 10, 11, 11); // cela s'affiche correctement !
} |