I have created a program for java fx to enter points in for an array. The points are to be shown with a line drawn between the maximal points. Also if you left mouse click it adds a point and recalculates the maximal points. If you right click it removes the point from the display. The problem I am running into is I am reading in a file with the points but nothing is showing in my display. I have even tried to manually add points and still nothing shows in the display. What am I missing?
I have tried everything I can to understand why no points are showing and am at a loss. I know it is something simple, but I cannot figure it out.
The points that should be added from the text file are
This is what it should look like when initially ran
This is what it actually looks like
I have corrected the mouse event so if I click in the upper left it will add points
Point.java
package application;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
public final class Point implements Comparable {
private final double x;
private final double y;
public Point(double x, double y) {
this.x = x;
this.y = y;
}
public double getX() {
return x;
}
public double getY() {
return y;
}
public boolean isBelowAndLeftOf(Point other) {
return this.x
No comments:
Post a Comment
Thanks