else if (fName.equals("locale")) dataarray = utils.AvailableLocales;
    public void loadFromFile(String fileName) {        Properties p = new Properties();        //System.err.println(fileName);        try {            FileInputStream filin = new FileInputStream(fileName);            p.load(filin);            filin.close();        } catch (FileNotFoundException e) {            return; // No file yet        } catch (IOException e) {            System.err.println("Error reading file '" + fileName + "': " + e.getMessage());            return;        }                Enumeration e = p.propertyNames();        while (e.hasMoreElements()) {            String fName = (String)e.nextElement();            try {                Field f = FaxOptions.class.getField(fName);                Class fcls = f.getType();                if (String.class.isAssignableFrom(fcls))                    f.set(this, p.getProperty(fName));                else if (Integer.TYPE.isAssignableFrom(fcls))                    f.setInt(this, Integer.parseInt(p.getProperty(fName)));                else if (Boolean.TYPE.isAssignableFrom(fcls))                    f.setBoolean(this, Boolean.parseBoolean(p.getProperty(fName)));                else if (MyManualMapObject.class.isAssignableFrom(fcls)) {                    MyManualMapObject[] dataarray;                                        if (fName.equals("tzone"))                         dataarray = utils.timezones;                    else if (fName.equals("notifyWhen"))                        dataarray = utils.notifications;                    else if (fName.equals("resolution"))                        dataarray = utils.resolutions;                    else if (fName.equals("paperSize"))                        dataarray = utils.papersizes;                    else if (fName.equals("newFaxAction"))                        dataarray = utils.newFaxActions;                    else {                        System.err.println("Unknown MyManualMapObject field: " + fName);                        continue;                    }                    Object res = utils.findInArray(dataarray, p.getProperty(fName));                    if (res != null)                        f.set(this, res);                    else                        System.err.println("Unknown value for MyManualMapObject field " + fName);                }                else if (Vector.class.isAssignableFrom(fcls)) {                    String[] fields = p.getProperty(fName).split(sepregex);                    FmtItem[] dataarray, required;                    Vector<FmtItem> vecres = new Vector<FmtItem>();                                        if (fName.equals("recvfmt")) {                        dataarray = utils.recvfmts;                        required = utils.requiredRecvFmts;                    } else if (fName.equals("sentfmt")) {                        dataarray = utils.jobfmts;                        required = utils.requiredSentFmts;                    } else if (fName.equals("sendingfmt")) {                        dataarray = utils.jobfmts;                        required = utils.requiredSendingFmts;                    } else {                        System.err.println("Unknown vector field name: " + fName);                        continue;                    }                    for (int i=0; i < fields.length; i++) {                        FmtItem res = (FmtItem)utils.findInArray(dataarray, fields[i]);                        if (res == null)                             System.err.println("FmtItem for " + fields[i] + "not found.");                        else                             if (!vecres.contains(res))                                vecres.add(res);                    }                                        utils.addUniqueToVec(vecres, required);                    f.set(this, vecres);                } else if (Rectangle.class.isAssignableFrom(fcls)) {                    String [] v =  p.getProperty(fName).split(sepregex);                    f.set(this, new Rectangle(Integer.parseInt(v[0]), Integer.parseInt(v[1]), Integer.parseInt(v[2]), Integer.parseInt(v[3])));                } else if (Point.class.isAssignableFrom(fcls)) {                    String [] v =  p.getProperty(fName).split(sepregex);                    f.set(this, new Point(Integer.parseInt(v[0]), Integer.parseInt(v[1])));                } else                    System.err.println("Unknown field type " + fcls.getName());            } catch (Exception e1) {                System.err.println("Couldn't load setting for " + fName + ": " + e1.getMessage());            }        }    }