FileInputStream reader = null;
InputStream reader2 = null;
try {
Loader loader = new Loader(getPreferencesFrame());
reader = new FileInputStream(file);
Template template = Template.create(reader);
reader2 = template.createStream();
LogisimFile.load(reader2, loader); // to see if OK
AppPreferences.setTemplateFile(file, template);
AppPreferences.setTemplateType(AppPreferences.TEMPLATE_CUSTOM);
} catch (LoaderException ex) {
} catch (IOException ex) {