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.

Similar Messages

  • 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

  • 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 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

  • 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 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.

  • Applet not refreshing in browser

    I wrote a HelloWorld applet and viewing it through internet explorer. when i modify the code, compile it, then it replaces the original .class file, but when i refresh the browser, it loads the original applet. when i delete the .class file from the directory, the applet still shows up on the browser after i refresh it. whats going on? and how do i update the applet.

    you hafta CLOSE the browser and then re-open it so the VM sarts up again

  • 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 Working in Browser

    I built a java applet that works fine in the applet viewer, but just appears as a gray screen in a web browser. In the status bar of the web browser, it says that the applet has been started. The only possible cause of this that I can think of is a failure to connect to the internet. The program should appear like that if it fails to connect to the internet when it first starts. If this is the problem, please see my other post about making that work.
    http://forum.java.sun.com/thread.jsp?forum=31&thread=449444&tstart=0&trange=15

    1) What Browser?
    2) What is you code?
    1) If it is Internet Explorer, the problem would be an outdated JVM. MS JVM only supports up to Java 1.1.8 so you would have to rework your Applet to fit with just those classes/methods present at that time (ie no Swing, and check the APIs to make sure that the since version isn't past 1.1.
    If you are using other browsers, the old JVM may be a problem as well. It should be easy enough to install the latest one.
    2) Start out with something simple, like a hello world. Get that to work, then worry about the more complicated stuff.

  • 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.

  • Applet notinited .. it runs in eclipse, but not in web browser --urgent

    hi,
    firstly i'm sorry for the "urgent" remark in the title, but I actually really need some help to this problem, since I have to pass up this assignment in about 2 more hours.
    on to the question,this is my full code:
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Container;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    import javax.swing.event.DocumentEvent;
    import javax.swing.event.DocumentListener;
    public class reza extends JApplet{
         public static void main(String[] args){
              JFrame myWindow = new JFrame("Sample reza");
              myWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              reza testReza = new reza();
              myWindow.setContentPane(testReza);//add to the window
              myWindow.pack();
              myWindow.setVisible(true);
         double sum;     //sum of values entered by user
         private ImageIcon board;
         private JPanel topPanel,boardPanel;
         private JLabel l1,l2,l3,l4,l5,l6,lTotal,lAndryusha,lBorya,lVolodya,lGiveUp,lGiveUp2,boardLabel,lRules;
         private JTextField a[],aTotal, b[], bTotal, c[], cTotal;
         private JButton clear,checkAnswer,solve;
         private Container container;
         String A1,A2,A3,A4,A5,A6,ATOTAL,B1,B2,B3,B4,B5,B6,BTOTAL,C1,C2,C3,C4,C5,C6,CTOTAL;
         public reza(){
              container = getContentPane();
             container.setLayout(new BorderLayout());
             topPanel = new JPanel(new GridLayout(6,8,5,5));
             boardPanel = new JPanel(new GridLayout(1,2,5,5));
             board = new ImageIcon("board.jpg");
             boardLabel = new JLabel(board);
             topPanel.setBackground(Color.WHITE);
             boardPanel.setBackground(Color.white);
             //utk handle button clear ngan solve
             ButtonHandler handler = new ButtonHandler();
             lGiveUp = new JLabel("           Give up?");
             lGiveUp2 = new JLabel("Press this >>>");
             lRules = new JLabel("Rules: User may only use the number shown in the dart board");
             l1 = new JLabel("   1");
             l2 = new JLabel("   2");
             l3 = new JLabel("   3");
             l4 = new JLabel("   4");
             l5 = new JLabel("   5");
             l6 = new JLabel("   6");
             lTotal = new JLabel("   Total");
             lAndryusha = new JLabel("Andryusha");
             lBorya = new JLabel("Borya");
             lVolodya = new JLabel("Volodya");
             a = new JTextField[7];
             b = new JTextField[7];
             c = new JTextField[7];
             aTotal = new JTextField();
             bTotal = new JTextField();
                cTotal = new JTextField();
                clear = new JButton("CLEAR");
             solve = new JButton("SOLVE");
             checkAnswer = new JButton("ANSWER");
             topPanel.add(new JLabel("       "));
             topPanel.add(l1);
             topPanel.add(l2);
             topPanel.add(l3);
             topPanel.add(l4);
             topPanel.add(l5);
             topPanel.add(l6);
             topPanel.add(lTotal);
             topPanel.add(lAndryusha);
             int i=1;
             for (i=1;i<=6;i++){
                  a[i] = new JTextField();
                  a.getDocument().addDocumentListener(new textFieldListenerA());
              topPanel.add(a[i]);
         topPanel.add(aTotal);
         topPanel.add(lBorya);
         for (i=1;i<=6;i++){
              b[i] = new JTextField();
              b[i].getDocument().addDocumentListener(new textFieldListenerB());
              topPanel.add(b[i]);
         topPanel.add(bTotal);
         topPanel.add(lVolodya);
         for (i=1;i<=6;i++){
              c[i] = new JTextField();
              c[i].getDocument().addDocumentListener(new textFieldListenerC());
              topPanel.add(c[i]);
         topPanel.add(cTotal);
         clear.addActionListener(handler);
         solve.addActionListener(handler);
         checkAnswer.addActionListener(handler);
         topPanel.add(new JLabel(" "));
         topPanel.add(new JLabel(" "));
         topPanel.add(new JLabel(" "));
         topPanel.add(new JLabel(" "));
         topPanel.add(new JLabel(" "));
         topPanel.add(new JLabel(" "));
         topPanel.add(clear);
         topPanel.add(solve);
         topPanel.add(new JLabel(" "));
         topPanel.add(lGiveUp);
         topPanel.add(lGiveUp2);
         topPanel.add(checkAnswer);
         topPanel.add(new JLabel(" "));
         topPanel.add(new JLabel(" "));
         topPanel.add(new JLabel(" "));
         topPanel.add(new JLabel(" "));
         boardPanel.add(boardLabel,BorderLayout.WEST);
         boardPanel.add(lRules,BorderLayout.EAST);
         container.add(boardPanel,BorderLayout.NORTH);
         container.add(topPanel,BorderLayout.CENTER);
         setSize(750,700);
         setVisible(true);
         class textFieldListenerA implements DocumentListener{
              public void insertUpdate(DocumentEvent e){
                   int i,count=0;
                   for (i=1;i<=6;i++){
                        try{                    
                             count = count + Integer.parseInt(a[i].getText());
                        }catch(Exception e1){
                   aTotal.setText("" + count);
              public void changedUpdate(DocumentEvent e){
              public void removeUpdate(DocumentEvent e){               
         class textFieldListenerB implements DocumentListener{
              public void insertUpdate(DocumentEvent e){
                   int i,count=0;
                   for (i=1;i<=6;i++){
                        try{                    
                             count = count + Integer.parseInt(b[i].getText());
                        }catch(Exception e1){                         
                   bTotal.setText("" + count);
              public void changedUpdate(DocumentEvent e){
              public void removeUpdate(DocumentEvent e){               
         class textFieldListenerC implements DocumentListener{
              public void insertUpdate(DocumentEvent e){
                   int i,count=0;
                   for (i=1;i<=6;i++){
                        try{                    
                             count = count + Integer.parseInt(c[i].getText());
                        }catch(Exception e1){
                   cTotal.setText("" + count);
              public void changedUpdate(DocumentEvent e){
                   int i,count=0;
                   for     (i=1;i<=6;i++){
                        try{                    
                             count = count + Integer.parseInt(c[i].getText());
                        }catch(Exception e1){
                   cTotal.setText("" + count);
              public void removeUpdate(DocumentEvent e){
                   int i,count=0;
                   for (i=1;i<=6;i++){
                        try{                    
                             count = count + Integer.parseInt(c[i].getText());
                        }catch(Exception e1){
                   cTotal.setText("" + count);
         private class ButtonHandler implements ActionListener{
              //handle button event
              public void actionPerformed(ActionEvent event){
                   //clear all the text fields
                   if (event.getActionCommand().equals("CLEAR")){
                        int i=0;
                        for (i=1;i<=6;i++){
                             a[i].setText("");
                        aTotal.setText("");
                        for (i=1;i<=6;i++){
                             b[i].setText("");
                        bTotal.setText("");
                        for (i=1;i<=6;i++){
                             c[i].setText("");
                        cTotal.setText("");                    
                   else if (event.getActionCommand().equals("SOLVE")){
                        int aCount[],bCount[],cCount[],i,aTotal=0,bTotal=0,cTotal=0;
                        aCount = new int[7];
                        bCount = new int[7];
                        cCount = new int[7];
                        //make sure all fields have been filled in
                        if (a[1].getText().equals("") || a[2].getText().equals("") || a[3].getText().equals("")|| a[4].getText().equals("")|| a[5].getText().equals("")|| a[6].getText().equals("")|| b[1].getText().equals("")|| b[2].getText().equals("")|| b[3].getText().equals("")|| b[4].getText().equals("")|| b[5].getText().equals("")|| b[6].getText().equals("")|| c[1].getText().equals("")|| c[2].getText().equals("")|| c[3].getText().equals("")|| c[4].getText().equals("")|| c[5].getText().equals("")|| c[6].getText().equals("")){
                             JOptionPane.showMessageDialog(null,"Please fill in ALL the scores!!");
                        //if yes, then only proceed
                        else{
                             //for andryusha
                             for (i=1;i<=6;i++){
                                  try{
                                       aCount[i] = Integer.parseInt(a[i].getText());
                                       aTotal = aTotal + aCount[i];
                                  }catch(Exception e1){
                             //check andryusha's 1st and 2nd shots. They must be equal to 22 when added
                             if (aCount[1] + aCount[2] != 22){
                                  JOptionPane.showMessageDialog(null,"Andryusha's 1st + 2nd shots must be equal to 22!!");
                             if (aTotal==71){
                                  JOptionPane.showMessageDialog(null,"Andryusha's scores is right! Well done!!");
                             }else if (aTotal !=71){
                                  JOptionPane.showMessageDialog(null,"You got it wrong for Andryusha's scores. Please try again.");
                             //for Borya
                             for (i=1;i<=6;i++){
                                  try{
                                       bCount[i] = Integer.parseInt(b[i].getText());
                                       bTotal = bTotal + bCount[i];
                                  }catch(Exception e1){
                             if (bTotal==71){
                                  JOptionPane.showMessageDialog(null,"Borya's scores is right! Well done!!");
                             }else if (bTotal !=71){
                                  JOptionPane.showMessageDialog(null,"You got it wrong for Borya's scores. Please try again.");
                             //for Volodya
                             for (i=1;i<=6;i++){
                                  try{
                                       cCount[i] = Integer.parseInt(c[i].getText());
                                       cTotal = cTotal + cCount[i];
                                  }catch(Exception e1){
                             if (cCount[1] != 3){
                                  JOptionPane.showMessageDialog(null,"Volodya's first score is wrong!!");
                             if (cTotal==71){
                                  if (cCount[2] == 50 || cCount[3] == 50 || cCount[4] == 50 || cCount[5]==50 || cCount[6]==50){
                                       JOptionPane.showMessageDialog(null,"Volodya's score is right! Well done!!");
                                  }else if (cCount[2] != 50 && cCount[3] != 50 && cCount[4] != 50 && cCount[5]!=50 && cCount[6]!=50){
                                       JOptionPane.showMessageDialog(null,"Volodya hits the bull's eye once!!");
                             }else if (cTotal!=71){
                                  JOptionPane.showMessageDialog(null,"Volodya's score is wrong!!");
                   }else if(event.getActionCommand().equals("ANSWER")){
                        a[1].setText("20");
                        a[2].setText("2");
                        a[3].setText("25");
                        a[4].setText("3");
                        a[5].setText("20");
                        a[6].setText("1");
                        aTotal.setText("71");
                        b[1].setText("25");
                        b[2].setText("20");
                        b[3].setText("20");
                        b[4].setText("3");
                        b[5].setText("2");
                        b[6].setText("1");
                        bTotal.setText("71");
                        c[1].setText("3");
                        c[2].setText("50");
                        c[3].setText("10");
                        c[4].setText("5");
                        c[5].setText("2");
                        c[6].setText("1");
                        cTotal.setText("71");
         }//end private class ButtonHandler
    I run the program using Eclipse; run as> Java applet
    and in runs perfectly well. I then tried running it using internet explorer and firefox, but only a gray box appeared and the browser says "applet notinited" and "Loading Java Applet Failed.."
    what did i do wrong? any help is really appreciated.. thanks

    thank God i already found the cause of the problem..
    it's because the application has an ImageIcon which links to a local jpeg file, so perhaps security restriction on the browser doesn't allow my applet to access local file, that's why it fails to load.
    either using signed applet (not tested) or removing the picture solved my problem.
    thanks anyway :)

  • Applet with Image not working in Browser, works fine in Appletviewer

    Hi,
    I encountered a problem , running my Applet in a browser. (IE and Firefox, ame problem).
    When I use an ImageIcon, it doesnot work. in a browser.(When I remove the icon, it's oke)
    In Appletviewer it works fine. In the browser I first got a security-exception.
    I dealed with that by signing the jar (with the test certificate).
    Now the browser's java console is not showin any faults, but the applet is showing no picture at all.
    Only the text of the label is shown.
    Can someone help me?
    I downgraded the class to a very simple form, shown underneath. This runs fine in Appletviewer, but not in a Browser.
    Best Regards
    Remco

    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 works on eclipse but not on reg browser (not inited error)

    Hi everybody,
    I've just made an applet, but I don't know why it can't be shown. I'm working with Eclipse, and when I run the .java file, everything works fine. It even works fine when I specify parameters through the eclipse build file parameter arguments.
    Now I would like this to work by using the appletviewer and my html file. When I do this, the application doesn't work anymore and I get this error: Start applet not inited and shows loading java Applet failed when I scroll over to the java applet box on the browser. (Mozilla)
    I used this code in the html file:
    <html>
    <head>
    <title>MicroToolBus Example Plugin Applet 2 </title>
    </head>
    <body>
    <h1>MicroToolBus Example Plugin Applet 2 </h1>
    <hr>
    <applet code =MicroToolBus.class width=400 height=100>
    <param name="ModelName" value="edu.vt.vbi.pathport.client.plugin.microarray.MicroarrayModel">
         <param name="DataLocation" value="c:/eclipse/workspace/PathPort/xml/samples/mageml/pmml.xml">
    </applet>
    </hr>
    </body>
    </html>
    which is located at
    C:\eclipse\workspace\PathPort\build\edu\vt\vbi\pathport\client\toolbus\MicroToolBus.html
    The MicroToolBus.class file is located in the same directory. What am I doing wrong. I tried putting the class file and the html in the same directory as the actual .java file of the applet, but that didn't seem to work either. Thanks in advance; your help and suggestions are much appreciated,

    What am I doing wrong?Your getting caught in the Sun/Microsoft war. Numerous casualties. For rehab, see:
    http://www.MartinRinehart.com
    Click "Articles", "Launching Applets".
    Warning: make a big mug of java before you start. This is not trivial stuff.

Maybe you are looking for