Exemplo n.º 1
0
 static {
   try {
     properties = new Properties();
     properties.load(Notepad.class.getResourceAsStream("resources/NotepadSystem.properties"));
     resources = ResourceBundle.getBundle("resources.Notepad", Locale.getDefault());
   } catch (MissingResourceException | IOException e) {
     System.err.println(
         "resources/Notepad.properties " + "or resources/NotepadSystem.properties not found");
     System.exit(1);
   }
 }
Exemplo n.º 2
0
  private void laden(Path saveName) throws IOException {
    Properties prop = new Properties();

    FileInputStream in = new FileInputStream(saveName.toString());
    prop.load(in);

    for (int i = 0; prop.containsKey(String.format("quellMenu%d", i)); i++)
      quellListModel.addElement(
          new ListItem(
              Paths.get(prop.getProperty(String.format("quellMenu%d", i))),
              Paths.get(prop.getProperty(String.format("quellMenu%d", i)))));
    for (int i = 0; prop.containsKey(String.format("zielMenu%d", i)); i++)
      zielListModel.addElement(
          new ListItem(
              Paths.get(prop.getProperty(String.format("zielMenu%d", i))),
              Paths.get(prop.getProperty(String.format("zielMenu%d", i)))));

    in.close();
  }