Converting netbeans app to applet
Hi, i'm writing a tictactoe game for uni course and am trying to implement it in a browser to run as an applet. The Java console produces there errors..
ava.lang.ClassCastException: gui.Frame cannot be cast to java.applet.Applet
at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassCastException: gui.Frame cannot be cast to java.applet.Applet
I have changed the closeonexitprocedure to none, this was causing a problem with security violation. I believe my problem now is that i need to extend my frame class with Applet, but not quite sure how :( Any help would be great, i'll post only a section of my code as i think the problem lies with defining the class inheritence.
package gui;
import javax.swing.*;
import logic.*;
import java.applet.Applet;
public class Frame extends javax.swing.JFrame
{
boolean playerOne = true;
private Facade facade;
int p1score = 0;
int p2score = 0;
private boolean[ ][ ] clicked;
/** Creates new form Frame */
public Frame() {
initComponents();
setLocation(100,100);
setSize(400, 300);
facade = new Facade();
clicked = new boolean[ 3 ][ 3 ];
for( int row = 0; row < 3; row++ )
{
for( int column = 0; column < 3; column++ )
{
clicked[ row ][ column ] = false;
}
}
}