title: Appending User Input into a string
body: <p>Im trying to append a string that users input into using global keypresses with an api I found. But I can't figure out how to add to the string without overwriting what is already there.</p>
  
  <pre><code>int i = 1;
  public String log = "Write";
  public String[] logger = new String[i];
  public static PrintStream out = null;
  public BufferedWriter writer = null;
  
  
  
  
      public void nativeKeyPressed(NativeKeyEvent e) {
          while(i&lt;1000000000){
  
          logger[i] = NativeKeyEvent.getKeyText(e.getKeyCode());
          i++;
          System.out.println(logger[i]);
          }
  </code></pre>