Пример #1
0
  public void readFile() throws IOException {
    try {

      FileInputStream fstream = new FileInputStream("dataIn.txt");
      DataInputStream in = new DataInputStream(fstream);
      BufferedReader br = new BufferedReader(new InputStreamReader(in));

      String strLine;
      int memi = -1;
      int strLineMemory = 59;

      while ((strLine = br.readLine()) != null) {

        t.data[strLineMemory++][1] = String.valueOf(strLine);
        memi++;

        size++;
        while ((strLine = br.readLine()) != null && !strLine.startsWith("*")) {

          String[] arr = strLine.split(" ");
          String command = arr[0];
          String operand = arr[1];

          toMemory(command, operand, memarray[memi]);
          memarray[memi] = memarray[memi] + 2;
          System.out.printf("%s %s ", command, operand);
        }
      }

      in.close();
    } catch (Exception e) { // Catch exception if any
      System.err.println("Error: " + e.getMessage());
    }

    MOSMain mos = new MOSMain();
    mos.planner();

    t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    t.setSize(830, 800);
    t.setVisible(true);
    t.setTitle("Printer");
    sortTime();
  }