Fomre triangle java
Résolu/Fermé
Bonjour,
je suis en train de faire un projet en java et j'en suis a la partie interface ( fenetre, panneau & co ...)
et ça va pas du tout !!
de la même façon qu'on peut faire un cercle et un carée(rectangle) je voudrais savoir comment faire la forme triangle !
merci de vos réponses
je suis en train de faire un projet en java et j'en suis a la partie interface ( fenetre, panneau & co ...)
et ça va pas du tout !!
de la même façon qu'on peut faire un cercle et un carée(rectangle) je voudrais savoir comment faire la forme triangle !
merci de vos réponses
A voir également:
- Fomre triangle java
- Waptrick java football - Télécharger - Jeux vidéo
- Jeux java itel football - Télécharger - Jeux vidéo
- Java apk - Télécharger - Langages
- Waptrick java voiture - Télécharger - Jeux vidéo
- Java décompiler - Télécharger - Langages
2 réponses
Utilisateur anonyme
26 mai 2009 à 20:07
26 mai 2009 à 20:07
Salut,
Ici: https://docs.oracle.com/javase/6/docs/api/
et en sélectionnant la classe Graphics (fenêtre All Classes à gauche) tu trouveras la méthode:
drawPolygon
public abstract void drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)Draws a closed polygon defined by arrays of x and y coordinates. Each pair of (x, y) coordinates defines a point.
This method draws the polygon defined by nPoint line segments, where the first nPoint - 1 line segments are line segments from (xPoints[i - 1], yPoints[i - 1]) to (xPoints[i], yPoints[i]), for 1 ≤ i ≤ nPoints. The figure is automatically closed by drawing a line connecting the final point to the first point, if those points are different.
Parameters:
xPoints - a an array of x coordinates.
yPoints - a an array of y coordinates.
nPoints - a the total number of points.
Cordialement,
Dan
Ici: https://docs.oracle.com/javase/6/docs/api/
et en sélectionnant la classe Graphics (fenêtre All Classes à gauche) tu trouveras la méthode:
drawPolygon
public abstract void drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)Draws a closed polygon defined by arrays of x and y coordinates. Each pair of (x, y) coordinates defines a point.
This method draws the polygon defined by nPoint line segments, where the first nPoint - 1 line segments are line segments from (xPoints[i - 1], yPoints[i - 1]) to (xPoints[i], yPoints[i]), for 1 ≤ i ≤ nPoints. The figure is automatically closed by drawing a line connecting the final point to the first point, if those points are different.
Parameters:
xPoints - a an array of x coordinates.
yPoints - a an array of y coordinates.
nPoints - a the total number of points.
Cordialement,
Dan