title: Why do I get a "No suitable method found for anonymous " error?
body: <pre><code>Runnable r = new Runnable() {
      @Override
      public void run() {
          if(varx) {
              new displayFullScreen().setVisible(true);
          } else {
              javax.swing.JOptionPane.showMessageDialog(this, "dfv"); // this statement gives an error
          }
      }
  };
  new Thread(r,"full_screen_display").start();
  </code></pre>
  
  <p>The error in the marked line says <code>"No suitable method found for anonymous (&lt;java.lang.Runnable&gt;,java.lang.String)</code>"</p>
  
  <p>Why does it so when i have directly written <code>javax.swing._CLASS_</code> ?</p>