I am attempting to convert a decimal number back to an integer for use on a map that users update with polygons, the polygon uses integers and i tried to cast the variable back to an int but its not working. I've tried the decimalformat, double.parsedouble etc. Here is a code snipet, I restored it to it's original format so you wont see anything i have tried, I'm new to
java so hopefully someone here can answer if not i'll try the intermediate or advanced forums. Thanks
public void updateLatLon() {
map.clearPolysNoRedraw();
areaPoly = new Polygon();
areaPoly.npoints = 4;
//XXX rounded off
int [] xpoints = new int[4];
int [] ypoints = new int[4];
xpoints[0] = (int)(panel.getNW().getLat() * 100);
ypoints[0] = (int)(panel.getNW().getLon() * 100);
xpoints[1] = (int)(panel.getNE().getLat() * 100);
ypoints[1] = (int)(panel.getNE().getLon() * 100);
xpoints[2] = (int)(panel.getSE().getLat() * 100);
ypoints[2] = (int)(panel.getSE().getLon() * 100);
xpoints[3] = (int)(panel.getSW().getLat() * 100);
ypoints[3] = (int)(panel.getSW().getLon() * 100);
areaPoly.xpoints = (int) xpoints;
areaPoly.ypoints = (int) ypoints;
map.draw(areaPoly);
}