applet can't be instantiated

[nobr]ive tryed lots of things on this

but every time it says applet can not be instantiated

heres the code

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

import java.io.*;

import java.net.*;

publicclass Maze3Dextends JAppletimplements ActionListener

{

//JLabel loginjlabel = new JLabel("<html>You are not loged in<br> Please login to continue<br></html>", JLabel.CENTER);

JLabel loginjlabel =new JLabel("<html>Because i havnt got the server done yet<br>just press login</html>", JLabel.CENTER);

JTextField username =new JTextField(10);//(6, 20);

JTextField password =new JTextField(10);

JButton loginButton =new JButton("<html>Login</html>");

public Maze3D(String args[])

{

//super("OutCastMZ");

String fnm =null;

if (args.length == 1)

fnm = args[0];

elseif (args.length == 0)

fnm ="maze.txt";// default maze file

else{

System.out.println("Usage: java Maze3D <fileName>");

System.exit(0);

}

if (Logedin == 1){

MazeManager mm =new MazeManager(fnm);

BirdsEye be =new BirdsEye(mm);// bird's eye view over the maze

SecondViewPanel secondVP =new SecondViewPanel(mm);

// panel with back-facing camera

WrapMaze3D w3d =new WrapMaze3D(mm, be, secondVP.getCamera2TG() );

Container c = getContentPane();

c.setLayout(new BoxLayout(c, BoxLayout.X_AXIS) );

c.add(w3d);// main camera pane

c.add( Box.createRigidArea(new Dimension(8,0)) );// some space

Box vertBox = Box.createVerticalBox();

vertBox.add( secondVP );// back-facing camera pane

vertBox.add( Box.createRigidArea(new Dimension(0,8)) );// space

vertBox.add(be);// bird's eyeview pane

c.add(vertBox);

//setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

// pack();

System.out.println("Connecting to ChatServer");

new ChatClient();

//setResizable(true);// fixed size display

setVisible(true);

}

else

{

//Container c5 = getContentPane();

c5.setLayout(new FlowLayout());

System.out.println("You are not loged in");

JPanel p1 =new JPanel(new BorderLayout());

c5.add(loginjlabel, BorderLayout.NORTH);

c5.add(username);//, BorderLayout.CENTER);

username.setText("UserName");

c5.add(password);

password.setText("PassWord");

c5.add(loginButton);

loginButton.addActionListener(this);

//setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

//pack();

//setResizable(true);

setVisible(true);

//new ChatClient();

}

}// end of Maze3D()

// --

Container c5 = getContentPane();

//JPanel p1 = new JPanel(new BorderLayout());

publicvoid actionPerformed(ActionEvent e)

{

if (e.getSource() == loginButton)

{

//if(lc.sendScore2(username.getText(), password.getText()).equalsIgnoreCase("accept"))

//{

remove(this);

c5.remove(loginjlabel);

c5.remove(username);

c5.remove(password);

c5.remove(loginButton);

showgame();

//}

//else

//{

//System.out.println("login failed");

//}

//System.out.println(e.getSource());

}

}

publicvoid showgame()

{

String fnm ="maze.txt";

MazeManager mm =new MazeManager(fnm);

BirdsEye be =new BirdsEye(mm);// bird's eye view over the maze

SecondViewPanel secondVP =new SecondViewPanel(mm);

// panel with back-facing camera

WrapMaze3D w3d =new WrapMaze3D(mm, be, secondVP.getCamera2TG() );

/* The main camera is shown on the left/center. On the right hand side

is the back facing camera above the bird's eye view (both

windows are quarter-size of the main one.)

*/

Container c = getContentPane();

c.setLayout(new BoxLayout(c, BoxLayout.X_AXIS) );

c.add(w3d);// main camera pane

c.add( Box.createRigidArea(new Dimension(8,0)) );// some space

Box vertBox = Box.createVerticalBox();

vertBox.add( secondVP );// back-facing camera pane

vertBox.add( Box.createRigidArea(new Dimension(0,8)) );// space

vertBox.add(be);// bird's eyeview pane

c.add(vertBox);

//setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

//pack();

//System.out.println("Connecting to ChatServer");

//new ChatClient();

//setResizable(true);// fixed size display

//setVisible(true);

}

publicstaticvoid init(String args[])

{

Maze3D ma =new Maze3D(args);

ma.aaaaa();

}

publicvoid aaaaa()

{

c5.setLayout(new FlowLayout());

System.out.println("You are not loged in");

JPanel p1 =new JPanel(new BorderLayout());

c5.add(loginjlabel, BorderLayout.NORTH);

c5.add(username);//, BorderLayout.CENTER);

username.setText("UserName");

c5.add(password);

password.setText("PassWord");

c5.add(loginButton);

loginButton.addActionListener(this);

//setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

//pack();

//setResizable(true);

setVisible(true);

//new ChatClient();

}

publicstaticvoid main(String[] args)

{new Maze3D(args);}

privateint Logedin = 0;

LoginClient lc =new LoginClient();

}

[/nobr]

[10199 byte] By [aaa801a] at [2007-11-27 9:58:40]
# 1
This is no goodpublic Maze3D(String args[])You need an empty constructor. I am not sure why this is an applet at all if you plan to feed it command line parameters.
cotton.ma at 2007-7-13 0:29:21 > top of Java-index,Java Essentials,Java Programming...
# 2
look at it actualyit doesnt need to have a arg from command line
aaa801a at 2007-7-13 0:29:21 > top of Java-index,Java Essentials,Java Programming...
# 3
> look at it actualyI did look. You don't listen.> it doesnt need to have a arg from command lineTry to actually listen this time okay?Where is the no argument constructor for your applet?
cotton.ma at 2007-7-13 0:29:21 > top of Java-index,Java Essentials,Java Programming...
# 4
ok i changed that and it still dont work
aaa801a at 2007-7-13 0:29:21 > top of Java-index,Java Essentials,Java Programming...
# 5
> ok i changed that and it still dont workWhat is the exact error?Get the stack trace by opening the Java console in the browser.
cotton.ma at 2007-7-13 0:29:21 > top of Java-index,Java Essentials,Java Programming...
# 6
nvm got it doneforgot to change static init to final
aaa801a at 2007-7-13 0:29:21 > top of Java-index,Java Essentials,Java Programming...
# 7
> nvm got it done> forgot to change static init to finalErrr that init method is also no good. You are not overriding the superclasses init method if that is what you think you are doing there.Another tip: User appletviewer instead of your browser to test
cotton.ma at 2007-7-13 0:29:21 > top of Java-index,Java Essentials,Java Programming...