• drproksch
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I have searched extensively for a solution of how to call a Java applet from a VF page and I cannot find a working example.  I have the following applet, which works fine the browser:

 

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

public class ExampleApplet extends JApplet
{
  public void init() {

 }

  public void paint(Graphics g)
  {
    setBackground(Color.white);
    g.drawString("Test String", 25, 30);
  }
}

 

The following VF page:

 

<apex:page StandardController="Demo_Object__c">

<h1>Applet Test

</h1><html><HEAD></HEAD><p>Starting applet</p>

<BODY BGCOLOR="000000">

<CENTER>

<APPLET

name = "MyExApplet"

code = "ExampleApplet.class"

codebase = "{!$Resource.ExApplet}"

width = "500"

height = "300"

>

</APPLET>

</CENTER>

</BODY>

</html>

</apex:page>

 

I have set up the applet as a static resource called ExApplet.

 

The VF page opens, but the applet fails.  There is a very brief error message saying class file not found.

 

Can someone help me with this.  It seems like a simple problem, but there are no complete examples I can find after several hours of searching.

 

Thanks.