title: how to control VLC by java
body: <p>I want to run a program called <em>VLC</em> in <code>java</code> and control it while running, for example if user clicked on <kbd>❚❚</kbd> or <kbd>►►</kbd> button, I do a specific suitable action.</p>
  
  <p>I run <code>VLC</code> by this code :</p>
  
  <pre><code>try
  {
      Runtime rt = Runtime.getRuntime();
      Process p = rt.exec(VLCProgramAddFile + " udp://@:" + listeningPort);
  
      OutputStream out = p.getOutputStream();
      InputStream in = p.getInputStream();
  
      p.waitFor();
      System.out.println("End of VLC");
  }
  catch (Exception e)
  {
      System.out.println("error in running VLC");
  }
  </code></pre>
  
  <p>I have heard about Java bindings, but I don't know how does it work for this job.</p>