applet

hi experts,

My Java applet is not running in Internet explorer.. but it is running in Netscape..
Also the Background sound is audible in Internet Explorer only not is Netscape..
Html code is given below
<html>
<head>
<bgsound src="abc.mp3" loop="-1" >
</head>
<body bgcolor ="black" text = "yellow" alink ="yellow" vlink="yellow">
<applet code ="Applet1.class" width=750 height=200>
</applet>
<font color="yellow"><h1 align = "right"><a href="pqr.asp">Enter </a></h1></font>
</body>
</html>

pls comment..
regs..
pvrajAsked:
Who is Participating?
 
Oliver_DornaufConnect With a Mentor Commented:
Pvraj you need to overide the init fuction for your applet.
Look at the documentation for details.

public void init() {

}


0
 
Oliver_DornaufCommented:
i think the bgsound for netscape is only mid. (And not so good style in a web page :-) )

for yout applett problem you should open the java console and send the messages to this forum.
0
 
dvijiCommented:
If you want to play mp3 then your browser should have the plugin otherwise it is not possible. Download load the plugin and install it. In netsacpe if you want to load the plugin you have to use <EMBED> tag.

For applet problem as Oliver mentioned see your java console.

..dviji

0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
randydCommented:
the applet tag should be expanded for each type of browser.

there is a utility that does the conversion for you...

you get an applet tag like this:

<!-- CONVERTER VERSION 1.3 --><object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="750" height="200" codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
<param name="CODE" value="Applet1.class">
<param name="ARCHIVE" value="http://yourhost/Applet1.jar">
<param name="type" value="application/x-java-applet;version=1.3"><param name="scriptable" value="false"><comment>
<embed type="application/x-java-applet;version=1.3" code="Applet1.class" archive="http://yourhost/Applet1.jar" width="276" height="190" scriptable="false" pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><!--
<APPLET CODE = "Applet1.class" ARCHIVE = "http://yourhost/Applet1.jar" WIDTH = "276" HEIGHT = "190"> </APPLET> --><!--"END_CONVERTED_APPLET"--></comment></object>


hth

randy
0
 
Oliver_DornaufCommented:
randy the applet tag you mentioned ist for the java-plugin from sun. You not need this in every case.
0
 
pvrajAuthor Commented:
i got confused
0
 
Oliver_DornaufCommented:
Confused about what ?

1) it is not possible to play mp3 without a plugin
2) To help you with your applett problem more information is needed. Noone can know why your applett not work when not get an error message.
So aktivate in the IE the java console. Use extras, Internetoptions, tab extendet mark at java vm java console.
reboot.
Select in menue view the java console.
OK ?
0
 
pvrajAuthor Commented:
Hi Oliver i m sorry .. i could not resolve it.. let me describe the problem i am facing..
import java.awt.*;
import java.awt.image.BufferedImage;
import java.applet.Applet;
public class Applet3 extends Applet
{    
     
     final static int Ball_radius =70;
     Image ball = null;
     Image applet = null;
     Graphics appG,ballG;

     public void paint(Graphics g)
     {
           setBackground(Color.black);
           if (ball==null)
    {
applet = new BufferedImage(getBounds().width, getBounds().height,BufferedImage.TYPE_INT_RGB);
ball = new BufferedImage(Ball_radius,Ball_radius,BufferedImage.TYPE_INT_RGB);
ballG = ball.getGraphics();
ballG.setColor(Color.green);
appG = applet.getGraphics();
appG.setColor(Color.black);
for(int i=-20;i<=0;i++)
  {
    ballG.drawOval(i,i,Ball_radius+((-1)*2),Ball_radius+((-1)*2));
  }
}
for(int x=0;x<400;x++)
{
     double angle =((double)x)/20;
     int y = (int)(Math.abs(Math.sin(angle))*80);
     appG.setColor(Color.white);
     appG.fillRect(0,0,getBounds().width,getBounds().height);
     appG.setColor(Color.red);
     appG.drawImage(ball,x,80-y,this);
     g.drawImage(applet,0,0,this);
    }
  }

}
this is the program for a bouncing ball..
1) As you suggested i tried to activate the java console from the view menu.. but nothing is happening there... when i clicked the java console from the view menu, it is simply closing the menu... then i went to tools-> internet opetion and there i set the java permissiion to low safety.. still nothing happened.. i even tried by downloading IE again from internet..
2) secondly when the same program i tried in Netscape it is displaying that it could not load the applet got a security violation..
3) When i tried to view the applet using Appletviewer it is showing the applet cause an exception in the native code ........
pls comment
 
0
 
CleanupPingCommented:
pvraj:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
VenabiliCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points for Oliver_Dornauf

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Venabili
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.