Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    embedding applets with the web browser

    i have java creator (JCreator), and i started a new applet, after compiling and executing, JCreator created a folder named with the same name of the applet and contains the web page that supposed to view the applet and the applet class also, when i wanted to view the web page the applet didn't appear? why?
    this is the .java code:
    Code:
    import java.awt.*;
    import java.applet.*;
    
    
    public class Aymen extends Applet {
    	
    	public void init() {
    	}
    
    	public void paint(Graphics g) {
    		g.drawString("This is the first applet", 50, 60 );
    	}
    }
    and this is the html code:
    Code:
    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    <CENTER>
    <APPLET
    	code	= "Aymen.class"
    	width	= "500"
    	height	= "300"
    	>
    </APPLET>
    </CENTER>
    </BODY>
    </HTML>

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Location
    Kentucky
    Posts
    133
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hello,

    This worked for me. Make sure you have the Aymen.class file in the same directory as the Aymen.html page.

  • #3
    Regular Coder
    Join Date
    Nov 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ya, i'm sure that the Aymen.class is in the same folder with the htm file

  • #4
    Regular Coder
    Join Date
    Nov 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •