READCONSOLE

   public void readConsole() {
      String input="";
      Scanner s = new Scanner(System.in); // lesen von Stream in
      while (!input.equals("9")) {
        for (int i=0; i<1; i++) System.out.println();
        System.out.println("Hauptmenue\n");
        System.out.println("1: write");
        System.out.println("2: read");
        System.out.println("3: write Buffered");
        System.out.println("4: read Buffered");
        System.out.println("9: Ende\n");
        System.out.print("Eingabe: ");
                
          input = s.next();
          if (input.equals("1")) write(false);          
          if (input.equals("2")) read(false);
          if (input.equals("3")) write(true);          
          if (input.equals("4")) read(true);

      }
      s.close();
      System.out.println("-------- Ende des Programms ---------");
   }  // ReadConsole


Programmieung 3
KeyListener