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

        setSize(new Integer(properties.getProperty("Size")));
        setXposition(new Integer(properties.getProperty("PosX")));
        setYposition(new Integer(properties.getProperty("PosY")));

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

        }
        in.close();
    }