0 Replies Latest reply: Aug 3, 2012 11:26 AM by MarcoNL RSS

    Next-gen Applet is completely blank on Mac OS X

    MarcoNL
      Hi.
      I am experiencing a strange behavior on Mac OS X with Java Applets deployed though the JNLP mechanism (i.e., exploiting the next-generation Java Plug-in).

      For testing purposes, I have developed a VERY SIMPLE applet, just setting a BorderLayout on JApplet's contentPane, then adding sample JButtons on sides, and a sample JLabel in the center. Here is the code:

      ====

      import java.awt.BorderLayout;
      import javax.swing.*;

      public class TestApplet extends JApplet
      {

      public void init()
      {
      uiInit();
      }

      // TODO overwrite start(), stop() and destroy() methods

      private void uiInit()
      {
      try
      {
      SwingUtilities.invokeAndWait(new Runnable()
      {
      public void run()
      {
      JButton northButton = new JButton("North button");
      JButton southButton = new JButton("South button");
      JButton eastButton = new JButton("East button");
      JButton westButton = new JButton("West button");
      JLabel centerLabel = new JLabel("Center label");

      getContentPane().setLayout(new BorderLayout());
      getContentPane().add(northButton, BorderLayout.NORTH);
      getContentPane().add(southButton, BorderLayout.SOUTH);
      getContentPane().add(eastButton, BorderLayout.EAST);
      getContentPane().add(westButton, BorderLayout.WEST);
      getContentPane().add(centerLabel, BorderLayout.CENTER);
      }
      });
      }
      catch (Exception ex)
      {
      // It's OK
      }
      }
      }

      ====

      While this simple Applet works fine on Windows clients running a recent JRE, it displays NOTHING on recent Mac OS X clients (tested on both Mac OS X 10.7 and 10.8).

      You can test this Applet yourself at:

      http://67.225.240.233/TestApplet/TestApplet.htm

      Can some Mac users check if they obtain a blank screen on their Mac OS X clients as well?
      Can someone guess why I am obtaining this behavior? A bug of Apple's implementation? If yes, it would be a really SERIOUS bug...

      It is important to notice that this same applet displays fine on Mac if using the "old fashioned" <applet> tag (i.e., no JNLP).

      Any feedback or hint would be greatly appreciated.
      Thanks and best regards,

      Marco