Bonjour à tous,
J'ai besoin de positionner une cible sur une carte de France en fonction de la ville sélectionnée, voila comment je fais :
Dans le View
Position.PlacerCible(Index, jLabel3.getGraphics());
Dans la classe Position
1 2 3 4 5 6 7 8 9 10 11
| public static void PlacerCible(int Index, Graphics g)
{
Point coorList = new Point();
coorList=Recherche_coordonnees(Index);
coorList.setLocation(coorList.x/5.4+122, coorList.y/(-4.25)+60);
Graphics2D g2 =(Graphics2D) g;
g2.clearRect(0,0,250,225);
g2.setColor(Color.red);
g2.drawOval(coorList.x, coorList.y, 20, 20) ;
} |
Le problème est que quand je veux effacer la cible pour en afficher une autre, il m'efface aussi l'image du jLabel.
Comment je devrais faire pour éviter ça?
Bonne journée,
Pierre
Partager