title: How to alter WM_CLASS value in a Java GUI application based on Swing or NetBeans Platform?
body: <p>All Swing/NetBeans-based Java GUI applications seem to have the same <code>WM_CLASS</code> value:</p>
  
  <pre><code>WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "java-lang-Thread"
  </code></pre>
  
  <p>This parameter can be viewed by issuing <code>xprop</code> command and pointing to the window. The practical purpose of customizing it is to let Mac-like docks (AWN, for example (and, perhaps, Ubuntu's Unity)) distinguish the application windows and group them under the application's pinned launcher icon. For this to work <code>StartupWMClass</code> parameter is to be set accordingly in the <code>.application</code> file in <code>~/.local/share/applications</code> or <code>/usr/share/applications</code>. Needless to say, AWN (and analogues) get confused in case more than one application uses the same string for <code>WM_CLASS</code>.</p>