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]

