Computer Science Canada

Help with java applets

Author:  Dan [ Fri Aug 08, 2003 6:41 pm ]
Post subject:  Help with java applets

i have been trying to get a java applet to run in my web browser using the html tag < APPLET >, but every time a load the page it says it can not find the class Confused .

HTML code:

<APPLET CODE = "JPasswordA.class" WIDTH = 450 HEIGHT = 200>

java code:

import javax.swing.*;
import java.awt.*;
public class JPasswordA extends JApplet
    JLabel enterPass = new JLabel("Eneter Password");
    public void init()
        Container con = getContentPane();

any ideas why this is not working?

Author:  rizzix [ Sun Aug 10, 2003 5:27 pm ]
Post subject: 

try modifying it to:

con.add(enterPass, BorderLayout.CENTER);

Author:  Dan [ Mon Aug 11, 2003 8:56 pm ]
Post subject: 

thanks for trying to help. but the problem was with my java instaltion on my computer. i reinstalled java on my computer and now it wroks fine. i guse i had an old or messed up verson of it Confused