Get MainWindowTitle equivalent in java
<p>i have this code about how to get the current running process using c#.net, it uses System.Diagnostics and Process i wonder how can i get this equivalent to java. i found many research but it does not give me the right answer. </p>

<pre><code>System.Diagnostics.Process[] process = new System.Diagnostics.Process.GetProcess();

foreach(Process p in process)
{
    if(p.MainWindowTitle &gt; 0)
    {
      console.writeline(p.MainwindowTitle);
    }
}
</code></pre>

<p>something like that!</p>
