title: How to enable antialiasing on java swing GUI
body: <p>I am using scala and java swing for the UI. I want to enable <strong>antialiasing</strong> for all </p>
  
  <pre><code>javax.swing.JComponent
  </code></pre>
  
  <p>Currently I use the following trait</p>
  
  <pre><code>trait Antialising extends javax.swing.JComponent{
  
     override def paint(g: Graphics): Unit = {
         g.asInstanceOf[Graphics2D].setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING, java.awt.RenderingHints.VALUE_ANTIALIAS_ON)
         super.paint(g)
     }
  }
  </code></pre>
  
  <p>and initialize all components with the addition "with Antialiasing" like for example</p>
  
  <pre><code>val fileMenu = new JMenu("File") with Antialising
  </code></pre>
  
  <p><strong>Question: Is there a way to enable antialiasing globally?</strong></p>
  
  <p>(I already tried following which is not working)</p>
  
  <pre><code>System.setProperty("awt.useSystemAAFontSettings","lcd");
  System.setProperty("swing.aatext", "true");
  </code></pre>