Applet works on applet viewer but not in html, why not?

I'm using Eclipse as a development system and the Eclipse applet viewer shows my applets with no problem. They work the way I expect them to work and all is well.
When I try to run them in Internet Explorer, I first get a security warning. OK, I trust myself, so I tell Internet Explorer to run the applet. All I get is the text "Hello Dolly", but the applet doesn't run.
I tried refreshing it, running it again, allowing popups and opening the file, but it just won't run. What could be wrong with something so trivial?
Any suggestions would be appreciated.
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Hello to Everyone</title>
</head>
<body>
<applet CODE="Hello.class" width=300 height=100>Hello Dolly
</applet>
</body>
</html>

Sorry, I didn't think there was anything special in the applet.
This just happens to be what I'm checking at the moment.
It has changed depending upon where in the tutorial I find myself.
Thanks for you help.
It has to be something really stupid that I'm missing, but since I'm still new at this game, I can miss something obvious to everyone else.
package hello;
import java.applet.Applet;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.util.Date;
public class Hello extends Applet implements Runnable {
     private static final long serialVersionUID = 1L;
     Color colors[] = new Color[50];
     Date date1 = null;
     Thread run1 = null;
     Font f1 = new Font("Ariel", Font.PLAIN, 14);
     public void run() {
          int i = 0;
          Thread currThread = Thread.currentThread();
          while (currThread == run1) {
               setForeground(colors);
               repaint();
               i++;
               if( i>= colors.length) i = 0;
               try { Thread.sleep(50); }
               catch (InterruptedException e) {}
     public void init() {
          int i;
          float c = 0.0f;
          for(i=0; i<colors.length; i++) {
               colors[i] = Color.getHSBColor(c, 1.0f, 1.0f);
               c += 0.2f;
     public void start() {
          if (run1 == null) {
               run1 = new Thread(this);
               run1.start();
     public void stop() {
          run1 = null;
     public void paint(Graphics g){
          date1 = new Date();
          g.setFont(f1);
          g.drawString(date1.toString(), 10, 50);

Similar Messages

  • Applet works in applet viewer but not in website.

    I am an experienced programmer, but new to java (second week). I have made working client/server chatroom in java that works when I use the applet viewer, but when trying to run the applet in an html file, I get this error.
    java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.1.3:5136 connect,resolve)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkConnect(Unknown Source)
         at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at client.Client.init(Client.java:34)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.1.3:5136 connect,resolvI am unsure how to fix this. My first guess is that it is a security issue. Do I need some certificate or something?

    I am trying to connect an applet to a server application run on my computer. The server application is run in the eclipse ide, but I doubt that makes a difference.
    When connecting to the server from the client run through the eclipse ide with the app viewer, everything works fine. When making an html file for the app and running it also on that computer it fails.
    I tried using localhost instead of my internal ip address, and it gave the same errors. I will try signing next, but there must be a way to get this to work without that.

  • Applet running in IDE's applet viewer but not within browser

    Hello,
    I have this applet which runs perfectly on JBuilder4's Applet viewer but when I access the HTML file which JBuilder generated as part of the applet creation the applet won't run.
    The parameters in the applet tag in the HTML file are correct, i.e. the code attribute of this tag has as its value the correct class that implements the applet.
    The only io operations associated with the applet are writing/reading objects to the socket's input/output stream, to communicate with a threaded server which has been started before running the applet. It all runs on the local host. So, I'm not sure it should be signed for it to run in the browser, should it?
    I have tried several browsers, and have the latest java plug-in installed.
    Any comments on this?

    Check this link which might be helpful:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=126261

  • Works in applet viewer but not in internet explorer

    I origionaly posted this on devshed. I got 55 views but no replies. It seems to be a common problem to which no one knows the answer. Surprise me :O)I'm sure this is a really common but there seems to be surprisinly litttle on the web about it.
    I developed a game applet a while ago in applet viewer and am now thinking about putting it on my web site. However I have found that it doesn't work in internet explorer. I can browse other sites using Java fine. There is clearly just something about my applet that ie doesn't like.
    Does anyone have any suggestions? What sort of things upset ie?
    All help very much apreciated, you are very nice people
    Flo.

    There must be some thing that tells you it isn't working. You should tell us so we don't have to guess. Does the browser hang? Do you get an error? Did you try opening the Java Console to see if there were any messages? I am guessing that your code is using something that the security level of an Applet does not allow (but appletviewer does allow).

  • Slideshow works on desktop viewer, but not on iPad

    I have an MSO slideshow that works great on the desktop viewer, but when previewed on the iPad it just shows the first state and doesn't transition to the next state.
    We have made slideshows before that work on both the desktop and iPad content viewer and can't seem to figure out what is causing these not to work. The filename links don't have any special characters or spaces in them. What causes this to happen?

    By any chance, do you link to the MSO from buttons in a scrollable frame? If so, you need to use a different method to convert the MSO to a slideshow. For example, you can select the MSO and choose "Swipe" in the Overlays panel, or you can create an invisible button with a "Go to Next State" action.

  • Applet works in applet viewer but not browser...why?

    I won't go into the code, but here's my problem: I work on my applet using Eclipse and its appletviewer, and the applet works fine. I test my applet once in a while by packing all class files and graphics into a jar file, copying it and html file to my desktop and opening the html file. Before, this would work (the applet would get all its info from the jar file), but now... I get a nullpointer exception when I open the browser. If this were to happen in Eclipse, I'd have some way of tracking it. Is there some way of tracking this problem when its seen in a browser?

    here's certain key parts of my code... I think this whole "applet not working outside of the project folder" thing started ever since I changed my init() and start() functions so...
         public void init()
              t = new Thread(this);
              t.start();
              addKeyListener(this);
              addMouseListener(this);
              addMouseMotionListener(this);
              sound = new SoundList(); 
         public void start()
              URL resdir;     
              resdir = getClass().getResource("Graphics/Spacebackdrop_01.jpg");
              backgrndImg = new ImageIcon(resdir);
                   resdir = getClass().getResource("Graphics/Ship_Blue.gif");
              player1 = new Ship(100, 300, new ImageIcon(resdir), this,
                        gameRect, sound);
              player1.setOrientation(90);
              resdir = getClass().getResource("Graphics/Ship_Green.png");
              player2 = new Ship(700, 300, new ImageIcon(resdir), this,
                        gameRect, sound);
              player2.setOrientation(270);
              resdir = getClass().getResource("Graphics/Ball.gif");
              ball = new Ball(50, 50, new ImageIcon(resdir), this,
                          gameRect, sound);
              initMenus();
              //Initialize the goals
              resdir = getClass().getResource("Graphics/Goalpost.png");
              ImageIcon goalImg = new ImageIcon(resdir);
              goal1 = new Goal(8, gameRect.height/2, 100, goalImg, this);
              goal2 = new Goal(gameRect.width - 8, gameRect.height/2, 100, goalImg, this);
              font = new Font("Verdana", Font.BOLD, 16);
         public void initMenus()
              startMenu = new Menu();
              pauseMenu = new Menu();     
              confirmMenu = new Menu();
              int setY = 200;
              ImageIcon img = new ImageIcon(getClass().getResource("Graphics/newgame.png"));
              ImageIcon imgRoll = new ImageIcon(getClass().getResource("Graphics/newgame_h.png"));
              ImageIcon imgPressed = new ImageIcon(getClass().getResource("Graphics/newgame_p.png"));
              startMenu.addCenteredButton(img, imgRoll, imgPressed, setY, 0, gameRect.width);
              pauseMenu.addCenteredButton(img, imgRoll, imgPressed, setY, 0, gameRect.width);
              setY += 20;
              img = new ImageIcon(getClass().getResource("Graphics/resumegame.png"));
              imgRoll = new ImageIcon(getClass().getResource("Graphics/resumegame_h.png"));
              imgPressed = new ImageIcon(getClass().getResource("Graphics/resumegame_p.png"));
              pauseMenu.addCenteredButton(img, imgRoll, imgPressed, setY, 0, gameRect.width);
              img = new ImageIcon(getClass().getResource("Graphics/Yes.png"));
              imgRoll = new ImageIcon(getClass().getResource("Graphics/Yes_h.png"));
              imgPressed = new ImageIcon(getClass().getResource("Graphics/Yes_p.png"));
              setY += 25;
              int imgWidth = img.getIconWidth();
              confirmMenu.addButton(img, imgRoll, imgPressed, gameRect.width/2 - imgWidth, setY);
              //startMenu.activate(); //make starmenu active.
              img = new ImageIcon(getClass().getResource("Graphics/No.png"));
              imgRoll = new ImageIcon(getClass().getResource("Graphics/No_h.png"));
              imgPressed = new ImageIcon(getClass().getResource("Graphics/No_p.png"));
              confirmMenu.addButton(img, imgRoll, imgPressed, gameRect.width/2 + 2, setY);
         }

  • Edited gif file will work in a viewer, but not in email client

    An animated gif file received in my email client, after editing will not work in the same email client, but is working properly in a browser. Further, the background in the altered gif is black in the email client instead of the non-pixelated file that was "saved for web."
    I had received thsi working gif file and made changes to send the altered animation back, wherin I encountered this quirky littel issue.
    Anyone had this problem or have answers to what's going on here?

    Hi Ozkarleo,
    Please post more information to make your question clear. What’s the type of project you are using? Universal app? Windows phone silverlight app?
    The Sqlite libraries in runtime project are different with those in WinForm. But you have not mentioned what libraries you are using in runtime, so I assume you are using this common ones.
    Sqlite for windows 8.1
    https://visualstudiogallery.msdn.microsoft.com/1d04f82f-2fe9-4727-a2f9-a2db127ddc9a.
    Sqlite for windows phone 8.1
    https://visualstudiogallery.msdn.microsoft.com/5d97faf6-39e3-4048-a0bc-adde2af75d1b.
    One thing important you need note is that we have no access to the entire file system in runtime app, copy the file to local storage then use it.
    A good sample you can get started with it. Get it form MSDN code gallery.
    https://code.msdn.microsoft.com/windowsapps/Using-SQLite-in-a-Windows-c16aea77 .
    If you cannot make it working, please post more information about your scenario.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • Custom installed font in iOS7 works in-app view but not in UIWebview or safari.

    I installed a custom font using "configuration profile" (delivering a font payload). Apps successfully used it correctly -- but Safari and UIWebview refuse to use it. Does anyone know how Safari/UIWebview font rendering work?  I cant imagine why it would not work on Safari at all.
    thanks

    I was able to reproduce this with Firefox.  Would you mind opening a new bug on this issue over at bugbase.adobe.com?
    In addition, you might want to repost this question over on the Flash Professional forums?  This forum is primarily for end users, the Pro forums will get you in touch with a wider developer audience.
    Thanks,
    Chris

  • My applet works in the appletviewer but not in the navigator

    My applet works in the appletviewer but not in the navigator
    exceptions problem1 and problem2 are throwed
    this is my code
    import java.applet.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ValiderHtml extends Applet implements ActionListener {
    JButton send =new JButton("Connexion");
    JScrollPane jscrollpane= new JScrollPane();
    DefaultListModel lignes=new DefaultListModel();
    JList lstURL = new JList(lignes);
    BufferedReader reader = null;
    String ligne;
    URL url;
    URLConnection conn;
       public void init(){   
       this.setSize(900,400);
       setLayout( new GridLayout(2,1));
       jscrollpane.setBounds(new Rectangle(19,53,160,73));
       jscrollpane.getViewport().add(lstURL,null);
       send.addActionListener(this);
            this.add(send);
       this.add(jscrollpane);
        public void actionPerformed(ActionEvent evt) {
             Send();
       public void Send(){
            try {
       url=new URL("http://www.developpez.com");
       conn = url.openConnection();
       reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    while ((ligne = reader.readLine()) != null) {
                     lignes.addElement(ligne);
        }//fin bloc try
       catch (Exception e) {
                   lignes.addElement("probleme1");     
                finally{
                   try{reader.close();}catch(Exception e){ lignes.addElement("probleme2");}
       }// fin Send
          public void paint(Graphics g) {
                super.paint(g);
    }// fin Applet

    As for tracking the source of your problem your applet sucks.
    Try e.printStackTrace() on a cought exception and check the (full) trace.
    url=new URL("http://www.developpez.com");
    Unless yor applet is on www.developpez.com this will throw an exception in an unsigned
    applet without special policies.
    Signing applets:
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post and last post for the java class file
    http://forum.java.sun.com/thread.jsp?forum=63&thread=409341
    4th post explaining how to set up your own policy with your own keystore

  • JMF works in Applet View, but in web browser, cannot find device

    I'm developing an Applet which can capture image from a web camera.
    It's working very well in the applet view, but it says "No devices" error message through web browser.
    How can I make it work? How can I find device on the web browser?
    I changed permission using "java JMFRegistry", and tried signed Jar.
    Anyone can help me?
    or some of samples would be appreciated...

    Applet view means Applet viewer..

  • Applets work under older compilers, but not newest

    The applets I compile using the latest release of javac (with the JDK 1.4 package) work in the appletviewer but not in IE 6.0. However, if I use an older version of javac from a couple years ago (not sure the version), the applets work in IE suddenly. Is there something I need to install in IE to make it compatible with the Sun 1.4 javac compiler? Should I just reinstall the JRE? Has anyone heard of this before? Thanks!!

    You could try installing the Java 1.4 plugin.
    http://java.sun.com/getjava/

  • The scroll function on my mousepad is disabled when viewing a pdf file in firefox version 5.0. The scroll works on the pdf, but not on the other tabs. When the pdf is closed, the scroll function returns to normal. Any ideas?!

    The scroll function on my mousepad is disabled when viewing a pdf file in firefox version 5.0. The scroll works on the pdf, but not on the other tabs. When the pdf is closed, the scroll function returns to normal. Any ideas?!

    Hey thanx for the help, it worked like a charm.
    I think firefox changed the application lay out, as I used to be able to choose my PDF opener from the list at " Adobe Acrobat Forms Document' where I could choose Nitro-PDF reader, but it has now moved all the way to the bottom like you suggested to the obvious place of "Portable Document Format" section.
    If someone didn't tell me , I wouldn't have scrolled all the way down to be able to find it... it really should be with all its cousins up the top...
    Cheers again..

  • My Javascript works in Dreamweaver Live View, But Not On The Server

    I set up a javascript function to set the focus to the first field in a form as the page loads.  It works fine in Dreamweaver's Live View, but not on the local or remote servers.  Here's the code:
    In the heading I have the following function:
    <script type="text/javascript">
    function setFocus()
    document.getElementById("firstname").focus();
    </script>
    In the <head tag, I have:
    <body onload="setFocus()" ...
    and the first field in the form is:
                <input name="firstname" type="text" id="firstname" style="text-align: center; color: #009; text-transform: capitalize; font-variant: normal; font-weight: bold; line-height: normal; font-style: normal; font-size: 14px; font-family: Arial, Helvetica, sans-serif;" tabindex="1" value="<?php echo $fstname; ?>" size="15" maxlength="20">
    I guess I must be missing something, but don't know what.

    EUREKA! (and OOOPPPPSS!)  I found the problem (and I thought javascript was case sensitive - according to the tutorial, it's supposed to be).
    Here's apparently wha hoppen.  The first field in the form is the person's first name, but it's also a SPRY validation field.  I gave the actual field the name and id of "firstname", and the SPRY validation the name "FirstName", figuring that scripts would be case sensitive.  In fact, when I first inserted the SPRY object, I tried to name it "firstname" also, but it wouldn't let me, so I capitalized the first letters, and it accepted that; that made me feel that this is OK.  Here's the entire field's code:          <label>First Name:
               <span id="FirstName">               
                <input name="fstname" type="text" id="fstname" style="text-align: center; color: #009; text-transform: capitalize; font-variant: normal; font-weight: bold; line-height: normal; font-style: normal; font-size: 14px; font-family: Arial, Helvetica, sans-serif;" tabindex="1" value="<?php echo $fstname; ?>" size="15" maxlength="20">
                <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Minimum number of characters not met.</span></span></label>
    I accidentally tripped over the answer when I started using the Dreamweaver's Edit>Find Next search to see if I had something else named "firstname", and I found that it located every permutation of that word (e.g. firstname, FirstName, FIRSTNAME etc.).  Having seen that, I tried changing the "name=" and "id=" to "fstname, and the same corresponding change in the javascript, and VOILA! it worked.  That leaves me rather curious about this alleged "case sensitivity" thing.  I get the impression that it IS case sensitive, except when IT'S NOT.  How does this work, and how do I know when it is and isn't?

  • How come I can see my div in design view but not in live view

    Hi,
    I have a div ID called "portfolio" that I can see in design view but not live view or on a browser. It's a little pink square and I want that square round also.
    I ran it through validator. It picked up some things in the style.css which I changed and the boilerplate.css that I did not. Because I thought DW auto creates code for boilerplate because I don't enter that code myself.
    It's also rejecting a lot of webkit code but this seems like standard webkit code that works elsewhere on the page.
    BTW: at what point does this brutal hand coding pay off in money and less heartache when Wordpress looks cleaner and is so much easier to use? I feel like I barely know HTML or CSS in terms of translating vision to reality and with all-browser functionality after months and months of on-line classes. How long are the pros at it till they reach a watershed point?
    here's my address: http://www.adjacentdimensionsmedia.com/home.html
    Here's my html:
    <body>
      <div class="gridContainer clearfix">
        <div id="div1" class="fluid"><img src="adtitle2.png" width="700" height="80" alt=""/></div>
      <div class="fluid"><div class="box-shad"><a href="index.html"></a></div>
      </div>
        <div id="portfolio">Portfolio</div>
    </body>
    Here's my CSS:
    .box-shad {
      margin-top: 200px;
      margin-left: 100px;
      width: 900px;
      height: 700px;
      display: block;
      background-image: url("images/Big-tree-trans1.png");
      background-size: 900px 700px;
      -webkit-box-shadow: 15px 15px 15px #000000 inset;
      box-shadow: 15px 15px 15px #000000 inset;
      -webkit-border-radius: 50%;
      border-radius: 50%;
      position: fixed;
    .box-shad a {
        display:block;
        width:900px;
        height:700px;
    #portfolio {
      width: 100px;
      height: 100px;
      margin-top: 0px;
      margin-right: 200px;
      margin-left: 200px;
      margin-bottom: 0px;
      border-radius: 75%;
      -webkit-border-radius: 75% 75%;
      background: pink;
      top: -300px;
      position: relative;

    The top:-300 is putting that div above the top of the browser viewport. Fix that and you'll see the div.

  • When i burn videos to a dvd-r disc it works on my macbook but not on a windows/pc or my dvd player. How can i make it work on all the above and not just a mac product?

    when i burn videos to a dvd-r disc it works on my macbook but not on a windows/pc or my dvd player. How can i make it work on all the above and not just a mac product?

    Unfortunately, the recording & movie industry does not respect the rights of the people who make them money, and thus you can only use the paid-for content in ways they see fit. Even if I lived in a bunker where no one else could possibly see the movie I paid for, therefor I'm not 'sharing it illegally', I would still not be allowed in a blue moon to copy that movie to DVD for TV viewing. Someone will tell you to get an AppleTV. How about Apple give us one for free? Until this changes, people wanting to use their content in multiple locations will continue to download music & movies via torrents, legally or illegally.

Maybe you are looking for

  • External display and sleep

    I currently have the "acrylic" Apple 20" display and a new MacBook. I have the mini DVI to DVI added to the DVI to ADC. All seems to be working nice, but I'd prefer to close the MacBook while using the desktop display. I already moved the menu over t

  • Solaris 10 6/06 sconadm/cacaoadm issues

    The System ( Solaris 10 6/06 s10s_u2wos_09a SPARC) was upgraded from Solaris 9 via live_upgrade(5). Try to register: # sconadm register -a -r profile sconadm is running ... no more output ... Hints from other forum posts: # cacaoadm stop # cacaoadm s

  • Dual Screen Setup

    Hi, I've just bought a Mac Mini and I'm in the process of setting it up to use as a pc and also a media centre connected to my HD Tv and I have a few questions I was hoping someone here could help me with. At the moment I have the Mac's HDMI out runn

  • SAP - Novell IDM Connector

    We are implementing a Novell IDM LDAP connector to interface with SAP HR systems. We are passing PA fields across via IDOC's. A routine (Novell side) creates a new User ID & E-Mail Address to be passed back to populate IT0105. We get the error messag

  • Modifying Field in vbap

    Hi Experts, i have to modify VBAP table field Business area(gsber) for creation of sales order(VA01) ,changinng of sales order(VA02) in which user exit i need to write the code..Plz help me on this. I tried in include MV45AFZZ userexit_save_document.