public void loadPropertiesFromFile(File fileName) throws IOException {
        FileInputStream in = new FileInputStream(fileName);
        Properties properties = new Properties();
        properties.loadFromXML(in);

        int x1 =(new Integer(properties.getProperty("x1")));
        int y1 =(new Integer(properties.getProperty("y1")));
        int r1 =(new Integer(properties.getProperty("r1")));

        int x2 =(new Integer(properties.getProperty("x2")));
        int y2 =(new Integer(properties.getProperty("y2")));
        int r2 =(new Integer(properties.getProperty("r2")));

        int n =(new Integer(properties.getProperty("n")));

        if (canSetXY(x1, y1, x2, y2, r1, r2)){
            setX1(x1);
            setX2(x2);
            setY1(y1);
            setY2(y2);
            setR1(r1);
            setR2(r2);
            setN(n);
        }

        try{
            setPanelWidth(new Integer(properties.getProperty("PanelWidth")));
            setPanelHeight(new Integer(properties.getProperty("PanelHeight")));
        } catch (Exception e){

        }
        in.close();
    }