Bon, déjà, faudrait que t'aies une classe Point:
public class Point{
private int x;
private int y;
public Point(int x, int y){
setX(x);
setY(y);
}
public Point(){
this.x = 0;
this.y = 0;
}
public void setX(int x){
this.x = x;
}
public void setY(int y){
this.y = y;
}
public int getX(){
return this.x;
}
public int getY(){
return this.y;
}
public boolean estAGaucheDe(Point p){
return this.x < p.getX();
}
}// end - class
Ta méthode de tri:
public void tri(Point[] points){
for (int taille = 0; taille < points.length ; taille++){
for (int i=1; i<taille; i++){
if (points[i-1].estAGaucheDe(points[i]){
Point swapPoint = points[i];
points[i] = points[i-1];
points[i-1] = swapPoint;
}
}
}
}
(j'ai pas touché à l'algorithme que t'utilise pour trier, juste tout bien mis en forme niveau code toussa.
Voilà.