Пример #1
0
 public static boolean saveKeyBindings(File f) {
   ObjectOutputStream os = null;
   try {
     os = new ObjectOutputStream(new FileOutputStream(f));
     GUIControl.storeKeys(os);
   } catch (IOException except) {
   } finally {
     if (os != null)
       try {
         os.close();
       } catch (IOException e1) {
         e1.printStackTrace();
         return false;
       }
   }
   return true;
 }
Пример #2
0
 public static boolean loadKeyBindings(File f) {
   ObjectInputStream is = null;
   try {
     is = new ObjectInputStream(new FileInputStream(f));
     GUIControl.retrieveKeys(is);
   } catch (IOException except) {
   } catch (ClassNotFoundException e1) {
     e1.printStackTrace();
   } finally {
     if (is != null)
       try {
         is.close();
       } catch (IOException e1) {
         e1.printStackTrace();
         return false;
       }
   }
   return true;
 }