Ho un problema con le Graphics2D:
quando compilo mi dice che non esiste il package Line2Dcodice:public void paint (Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setColor (Color.black); if (! fromKeyBoard) // Attivazione da mouse switch (nClick) { case 1: if (pA > 0) g2.draw (new Line2D.Double (xArray[pA], yArray[pA], xArray[pA-1], yArray[pA-1])); g2.setColor (Color.black); g2.drawString (testoBase, xArray[pA], yArray[pA] - 5); break; case 2: g2.drawLine (xArray[pLast], yArray[pLast], xArray[0], yArray[0]); break; } if (fromKeyBoard) { // Attivazione da keyboard g2.setColor (Color.black); switch (nClick) { case 1: g2.drawString (testo, xArray[pA], yArray[pA] - 5); break; case 2: g2.drawString (testo, xArray[pLast], yArray[pLast] - 5); break; } } }
perchč??![]()
Grazie![]()

Rispondi quotando

