Applet - not rendering n Browser - Mozilla / IE - Help

Hi,
I have following code in AnotherHello.html in
<html>
<body>
<applet code="AnotherHello.class" width="300" height="150"></applet>
</body>
</html>and the following in AnotherHello.java
import java.awt.*;
import java.applet.Applet;
class  AnotherHello extends Applet
     public void paint(Graphics gr)     
          setBackground(Color.lightGray);
          gr.drawString("Hello", (300/2 - 40/2), (150/2 + 40/2));
}When I run it using Mozilla or IE it only shows the HTML code in the browser, it does not get me the applet on to the screen. Could somebody help me in figuring out the problem.
Thanks in advance.

I have only these two browsers so dont know about
other browsers.
No it does not run in applet viewer also.
I have the class file compiled in the same directory
as in the java and the html file.
I am able to see applets from various websites in my
mozilla browser, which would mean that applet is
enabled.
I am not sure what could be the problem.
Please do let me know.Sounds like it should run then. Maybe it is, but what it's drawing is "invisible" - what about removing that setBackground call, or set it to a different color. If you get a different result, then it is running.

Similar Messages

  • Applet not viewable in browser

    Hi
    applet not viewable in browser any website that uses java code seems not to run on my browser though it runs normally well on my friends computer. The browser shows a screen area in grey colour with an error message like "Exception: java.lang.ClassNotFoundException:GUIDemo.class" (im using Win NT4 and IE 5.5) checked the tools/internet options/advanced seettings the browser support is enabled. tried installing the newer version of JRE still not working ..Please guide about any settings that need to be modified or how can i fix this problem ..
    Regards
    anant
    [email protected]

    Hi
    Just a thought, but what broswer are you and your friend using? Are they different by any chance?
    There is an inconsistency between browsers and java, and unfortunately it can result in the error you saw.
    Basically, bog standard Internet Explorer uses its own JVM, whereas Netscape, Mozilla, Opera etc tend to use the java plug-in. To make matters worse, if you install the plug-in on a machine that has Internet Explorer installed, it over-rules the Microsoft version to make itself the default (but this can be undone by looking in the Options menu for Java-plugin and un-ticking the box). Give that a try first.
    Another cause that I have encountered was when using NT on a network, which had been configured not to accept Java Applets at all! Are you on such a network, or stand alone?
    Hope that helps.

  • The address bar where I can type in internet addresses is not showing on my Mozilla, please help me with this.....how do I enable it?

    The address bar where I can type in internet addresses is not showing on my Mozilla, please help me with this.....how do I enable it?

    Thanks friends, I got it resolved at last.............kdwis

  • Applet not running in browser?

    Hi
    What is the reason why an applet will be running in appletviewer but not in a browser???

    Hi,
    Try out with this html file:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <html>
    <head>
    <title>Example</title>
    <script language="JavaScript">
    function MyToolBar()
    window.open("Login.html","LoginPage","toolbar=0,menubar=0,scrollbar=0,resizable=0,directories=0,width='110%',height='150%'");
    </script>
    </head>
    <body>
    <blockquote>
    <!--"CONVERTED_APPLET"-->
    <!-- CONVERTER VERSION 1.1 -->
    <SCRIPT LANGUAGE="JavaScript"><!--
    var info = navigator.userAgent; var ns = false;
    var ie = (info.indexOf("MSIE") > 0 && info.indexOf("Win") > 0 && info.indexOf("Windows 3.1") < 0);
    //--></SCRIPT>
    <COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
    var ns = (navigator.appName.indexOf("Netscape") >= 0 && ((info.indexOf("Win") > 0 && info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) | | (info.indexOf("Sun") > 0) | | (_info.indexOf("Linux") > 0)));
    //--></SCRIPT></COMMENT>
    <SCRIPT LANGUAGE="JavaScript"><!--
    if (_ie == true) document.writeln('<Center><OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "100%" HEIGHT = "150%" codebase="http://java.sun.com/products/plugin/1.1.2/jinstall-112-win32.cab#Version=1,1,2,0"><NOEMBED><XMP>');
    else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.1.2" java_CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" pluginspage="http://java.sun.com/products/plugin/1.1.2/plugin-install.html"><NOEMBED><XMP>');
    //--></SCRIPT>
    <APPLET CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" ></XMP>
    <PARAM NAME = CODE VALUE = "MyApplet.class" >
    </APPLET>
    </NOEMBED></EMBED></OBJECT></Center>
    <!--
    <APPLET CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" >
    </APPLET>
    -->
    </body>
    </html>
    Hope this will help you.
    Anil
    Developer Technical Support
    Sun Microsystems Inc,
    http://www.sun.com/developers/support

  • Crystal report not rendering properly on Mozilla ?

    Hi,
    We are using VS2008,CR2008 on server 2012. In Chrome & IE CR working properly.
    But when I am using Mozilla with updated version not rendering properly.

    This is an old version of this issue that might give some insight:
    *[http://stackoverflow.com/questions/19768144/crystal-report-v10-5-toolbar-not-visible-on-firefox-but-visible-on-ie-and-chrome]
    also (but I am not sure what version you are using): " CR 10.5 is one of the versions that was not updated to support IIS7." from [http://www.experts-exchange.com/Database/Reporting/Crystal_Reports/Q_28350929.html]
    It might be ideal to ask a developer in stackoverflow.com or file a bug with webcompat.com for expert investigation for crystal reports. I am sorry I could not be more helpful.

  • Thumbnail not rendered in browser

    I lifted code posted in this forum for creating a jpg thumbnail courtesy of
    --Dmitri Don
    http://forum.java.sun.com/thread.jspa?threadID=223186
    and it works fine to make a nice sharp image.
    I am having a problem with certain thumbnails not showing in the browser. I suspect the size is the culprit but I AM NOT AN IMAGE EXPERT--and have little experience with these APIs. I would deeply appreciate someone's help on this. The thumbnail is being produced, I jsut cannot get the browser to show it for certain files.
    An example for a non working versus working is as follows:
    -working-:
    -original -96KB JPEG
    thumb-I can see size=4014bytes, dimension=100X75 px, type=JPEG and created/modified dates in BROWSER properties(right click)
    -non working-:
    original -670KB JPEG
    thumb-size=Not Available, dimension=20X30(!??) px, type=Not Available and created/modified dates=Not Available in BROWSER properties(right click)
    When I open the 'non-working' thumbnail in an image editor it has normal properties: size=22500bytes, dimension=100X75 px, type=True Color 24 bit(in MS photo editor)
    the code I am using to generate the thumbs:
    try {
    File originalFile = new File(pathToOriginal);
    ImageIcon ii = new ImageIcon(originalFile.getCanonicalPath());
    Image i = ii.getImage();
    Image resizedImage = null;
    int maxSize = 100;
    int iWidth = i.getWidth(null);
    int iHeight = i.getHeight(null);
    if (iWidth > iHeight) {
    resizedImage = i.getScaledInstance(maxSize, (maxSize * iHeight)
    / iWidth, Image.SCALE_SMOOTH);
    } else {
    resizedImage = i.getScaledInstance(
    (maxSize * iWidth) / iHeight, maxSize,
    Image.SCALE_SMOOTH);
    // This code ensures that all the
    // pixels in the image are loaded.
    Image temp = new ImageIcon(resizedImage).getImage();
    // Create the buffered image.
    BufferedImage bufferedImage = new BufferedImage(
    temp.getWidth(null), temp.getHeight(null),
    BufferedImage.TYPE_INT_RGB);
    // Copy image to buffered image.
    Graphics g = bufferedImage.createGraphics();
    // Clear background and paint the image.
    g.setColor(Color.white);
    g.fillRect(0, 0, temp.getWidth(null), temp.getHeight(null));
    g.drawImage(temp, 0, 0, null);
    g.dispose();
    // sharpen
    float[] sharpenArray = { 0, -1, 0, -1, 5, -1, 0, -1, 0 };
    Kernel kernel = new Kernel(3, 3, sharpenArray);
    ConvolveOp cOp = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null);
    bufferedImage = cOp.filter(bufferedImage, null);
    /* write the jpeg to a file */
    File file = new File(pathToWrite);
    FileOutputStream out = new FileOutputStream(file);
    /* encodes image as a JPEG data stream */
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    com.sun.image.codec.jpeg.JPEGEncodeParam param = encoder
    .getDefaultJPEGEncodeParam(bufferedImage);
    param.setQuality(0.7f, true);
    encoder.setJPEGEncodeParam(param);
    encoder.encode(bufferedImage);
    catch exception...
    thanks
    sgv

    I realized the problem is nothing to do with the code...thanks anyway...

  • .svg files not rendering in browser

    I've just uploaded my site (www.elcricdercas.com). None of the .svg files are rendering. This includes an Edge produced file in the front page animation. How come? I've checked the site on Safari and Firefox. The provider is Eclipse.net.uk

    Hi,
    Could you please check this thread, and see if get some hint
    Re: SVG files not rendering in Muse

  • Applet not opening in browser  Help needed

    Hi experts,
    I have Java installed in my machine in the path C:\Program Files\Java
    While trying to open the link http://www.radinks.com/upload/applet.php in browser, I am being asked to install the missing plugin and that plugin is java.
    I do not know why this happens and I am stuck with this problem for sometime.
    Any help in this regard will be well appreciated with dukes.
    Thanks in advance,
    Kind Regards,
    Anees

    faheemhameed wrote:
    I have the same issue. But this is on Internet Explorer 8. Firefox is fine.Given the [web page does not validate|http://validator.w3.org/check?uri=http%3A%2F%2Fwww.radinks.com%2Fupload%2Fapplet.php&charset=(detect+automatically)&doctype=Inline&group=0] *(<- link),* I am not surprised it fails in some browsers while working in others. Checking the source of the page itself, I notice the applet is embedded in the page using an OBJECT element only, and that possibly also explains why it works in some browsers but not others.
    The best bet of the author of the web page is to defer writing the applet element to the [deployJava.js|http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html#deplToolkit] *(<- link)* that is provided by Sun.
    Unfortunately there is little that you can do about it, unless you want to attempt creating a page to load off your hard disk, that is valid and workable for IE. I cannot guarantee it will work, but try this variant..
    The altered web page, which can be tested at [http://pscode.org/test/radinks/applet.html].
    <html>
    <body>
    <applet
      code="com.radinks.dnd.DNDAppletPlus"
      archive="dndplus.jar"
      codebase="http://www.radinks.com/upload/"
      width= "290"
      height= "290"
      alt="Java is recognised, but disabled!">
        <param name="url" value = "http://67.131.250.110/upload.php">
        <param name="message" value="http://www.radinks.com/upload/init.html">
        <param name="name" value="Rad Upload Plus">
        <param name="max_upload" value="10000">
        <param name="encode_path" value="yes">
        <param name="translate_path" value="yes">
        <param name="full_path" value="yes">
    This browser does not recognise the Java APPLET element.  Get Java from www.java.com.
    </applet>
    </body>
    </html>

  • Applet not showing on browser even if its loaded

    I have created an applet which has some textfields and buttons.
    But when i want to see the applet in browser , it says it has been loaded but shows nothing. i have used swing for applet creation.
    help me out of this.

    What browser? What HTML code?
    Email me and I'll send you an article I've written on this subject. It is NOT as simple as it was 10 years ago.
    You'll need to use <APPLET> for macintosh, <EMBED> for MSIE and <OBJECT> for Netscape/Mozilla/Firefox/Opera. Then you'll need to understand 'code=' (see my reply to CleopatraL).

  • Applet not runing in Browser,although it runs in appletviewer.

    Hello! I have created an applet which connects to an Oracle Database executes some queries and after some processing on the data selected it returns the results. When i run the applet using appletviewer everything works fine.(appletviewer -J-Djava.security.policy=C:\folder\mypolicy.java.policy C:\folder\applet2.html is the command i used).
    The code of the HTML file i used is:
    <html>
    <head>
    </head>
    <body>
    <applet code=applet2 archive=applet2.jar width=600 height=600>
    </applet>
    </body>
    </html>
    However when i run the html page(Mozilla Firefox) i get a white page with a frame where Java starts to load and then nothing happens. The frame remains white and i don't see the results that i see when i use appletviewer. I really don't know what is wrong and i would appreciate any answers cause i am new to this.
    Thanx in advance...
    Edited by: lefos987 on May 26, 2009 2:03 PM

    lefos987 wrote:
    appletviewer -J-Djava.security.policy=C:\folder\mypolicy.java.policy C:\folder\applet2.htmlWhen you run it via a browser, how do you propose to get the browser to acknowledge the custom security policy? You can't pass command line arguments to it.
    However when i run the html page(Mozilla Firefox) i get a white page with a frame where Java starts to load and then nothing happens.It likely threw an exception, which you can get the detail of via the browser if you look for something like "Show Java Console".
    Another note: The applet viewer runs in a different security model than browsers do, so if your applet is trying to access resources on the client machine, the browser isn't going to let that happen. In this case, probably it shouldn't be an applet in the first place.

  • Applet not working in browser, works with appletviewer

    Hi,
    I'm trying to use an Applet program from the tutorials which keeps on displaying time in the HTML page:
    import java.awt.Graphics;
    import java.util.*;
    import java.text.DateFormat;
    import java.applet.Applet;
    public class home_page extends Applet implements Runnable {
        private Thread clockThread = null;
        public void init()
        public void start() {
            if (clockThread == null) {
                clockThread = new Thread(this, "Clock");
                clockThread.start();
        public void run() {
            Thread myThread = Thread.currentThread();
            while (clockThread == myThread) {
                repaint();
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e){
                // the VM doesn't want us to sleep anymore,
                // so get back to work
        public void paint(Graphics g) {
            // get the time and convert it to a date
            Calendar cal = Calendar.getInstance();
            Date date = cal.getTime();
            // format it and display it
            DateFormat dateFormatter = DateFormat.getTimeInstance();
            g.drawString(dateFormatter.format(date), 5, 20);
        // overrides Applet's stop method, not Thread's
        public void stop() {
            clockThread = null;
    }When i use this program in the browser, i cannot see the clock but i'm able to see only a gray box. I'm using the applet tag within the HTML page.
    I can see the same compiled applet running successfully with appletviewer program.
    Please help me out of this predicament.
    -Manish

    I have recently had the same problem, after lots of searching, I found that only Java 1.1 is supported by browsers, leaving out everything else including swing. So if you cant play the applet through your browser you need to download the appropriate patch i think about 5mbs.
    You should find one at java.sun.com/getjava/download.html
    Mine worked fine afterwards

  • Applet not rendered in IE8 loaded via iframe dynamically

    Hi,
    I have an applet that is loaded inside an iframe. The iframe is added to the document via javascript dynamically. When i add the iframe to the html page, the applet is not getting rendered in IE8. Working as expected in all other browsers.
    Interestingly, If i do any other action on the page like clicking on a check box after calling the javascript method that adds the iframe, the applet is being rendered .
    And if i add the iframe to the html statically, even in this case it works. Please help out with this.

    Hi,
    post questions about web site development to stackoverflow (IE forums). Include with your questions a link to your website or a mashup that shows the issue.
    go to java.com to update your Java RTE version and to remove outdated versions from your machines.
    web pages using the file protocol (file://) will not load external (http(s)) content.
    Tools>Internet Options>Security tab, click "Reset all zones to default". MSIE has security zone settings for scripted applets and unsigned controls.
    Start>Control Panel>Java JRT - Oracle Java JRT has security settings also.
    Regards.
    Questions regarding Internet Explorer 8, 9 and 10 and Internet Explorer 11 for the IT Pro Audience. Topics covered are: Installation, Deployment, Configuration, Security, Group Policy, Management questions. If you are a consumer looking for answers or to
    raise a question, it's highly recommended you head on over to http://answers.microsoft.com/en-us
    Rob^_^

  • Applet not showing in browser/only getting a grey box

    Hell to all....
    I am using a trial version of MS J++ and every time i execute to the browser i dont see my output all i get is a lil grey box on left side with header rules (<hr> tage in HTML) surounding the box. Can anyone help me out???
    if you need my code i will post it.
    Thanks in advance!

    OK ABUSE, check this out
    this is what i'm trying to do....The boss just wants me to connect to our database...and that's it....all i want to do is to see if i can connect to our database....so all the code is suspose to do is say database connected if it did and if it didn't then it should say connection failure...here is the code once again this is the code and that's it....
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.applet.Applet;
    public class Test extends Applet
    public static final String DB_URL = "jdbc:microsoft:sqlserver://<IP HOST>";
    private Connection conn;
    public void init(){
         try {
              DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver() );
              //Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
              this.conn = DriverManager.getConnection(DB_URL, "user", "pass");
              Statement stmt = conn.createStatement();
         catch (SQLException e){
              System.out.println("Cannot open database connection: " + e.getMessage());
         System.out.println("Connected to database");
    hope you understand what i'm trying to do....

  • Applet not showing in browser OR appletviewer window not appearing

    hi
    1. I have small java code - hello.java
    import java.awt.Graphics;
    public class hello extends java.applet.Applet
    public void paint(Graphics g)
    g.drawString("Hello java...................",600,300);
    which correctly compiled
    2. then I wrote an html file - hello.htm
    <HTML>
    <HEAD>
    <TITLE>HELLO</TITLE>
    </HEAD>
    <BODY>
    <appllet code="hello.class" width=400 height=400>hello not supported
    </appllet>
    </BODY>
    </HTML>
    3. but F:\javacode>appletviewer hello.htm not showing appletviwer window
    command prompt move to F:\javacode>
    4. opend the hello.htm through browser, "hello not supported " appearing instead of applet
    5. both files in same folder
    6. I am using IE8 & firefox (XP sp2)
    wh

    Quite apart from which a String drawn at [600, 300] wouldn't be visible in an Applet of width 400.
    db
    edit
    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    Edited by: DarrylBurke

  • Database applet not working in browser

    I am working on windows 2000 server. I have an applet that connects to a ms access database.Everything works in appletviewer. When i try to view the applet in ie i get the following error:
    Error: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
    null
    Error: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
    null
    access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
    Basically i am trying to serve the applet on IIS. When I try to access the html page from
    a different machine, the applet loads and looks good except fails to connect with the database and display
    data.
    Any help will be highly appreciated.
    fnjoel

    You are not allowed to access Databases directly form an applet
    This is a security issue in Java Applets.

Maybe you are looking for

  • Issue withRAW files from Canon 5DMKIII in camera RAW 7.0

    Hello,  I use Adobe Photoshop CS6 with Camera Raw 7. Photoshop  Bridge CS6 do not recognize the RAW files from the Canon 5D Mark III, any idea? Thanks in advance.

  • Unified Framework Page - Search functionality - How-To?

    All, We are trying a way to use UFP as the portal framework page to launch ESS and MSS Landing Pages. Anyone out there who has gone this route? Any experiences that you would like to share? There is not enough information on UFP. We are particularly

  • FieldPointOPC2.exe Driver & Communication Loss

    Background/Environment: Currently I have a legacy hardware system utilizing older FieldPoint FP-1600 ethernet modules with a couple of Discrete Input & Output modules.  I run a custom desktop Visual C++ application which connects to the FieldPoint ar

  • Can't repair broken links

    Hi I've got 267 broken links on a single page, all images. there seems to be no difference between surviving links and broken links, I have tried to fix the links in the link inspector and the properties panel, which failed. I think this might take a

  • South Africa Online number Free State (051)

    Hi I would like a online number, but my area code is not desplayed - can Bloemfontein (051) area code be added??