title: Custom Java Window Title Bar Menu
body: <p>I'm trying to allow the user to change the title of a window in Java without adding components to the window itself. I'm actually trying this with a <code>JInternalFrame</code>, but figure the solution should be similar for a <code>JFrame</code>. I simply want to add an additional menu item in the context menu that pops up when right clicking on a window title bar. For example, the <em>Set title</em> below:</p>
  
  <p><img src="https://i.stack.imgur.com/c6laP.png" alt="enter image description here"></p>
  
  <p>This example is on Windows XP, but perhaps there's a way to get the window context menu OS independently perhaps similar to the <code>SystemTray.getSystemTray()</code> (but for individual windows <em>within</em> an application). From this I would be able to provide my own <code>ActionListener</code> to popup a dialog for the user to enter a new title.</p>
  
  <p>Is this a much bigger task than I'm guessing it is? Does anyone have solutions they've used before?</p>