Why is my java applet blank? (Simple)

I just tried to make an applet with a textbox, a label and a button, but nothing shows up!
Here's the code I'm using:
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import java.awt.event.*;
public class TestApplet extends JApplet{
  JFrame fFrame;
  JLabel label1 = new JLabel("Label: ", JLabel.LEFT);
  JTextField txtbox = new JTextField(10);
  JButton btnStart = new JButton("Press Here");
  JPanel MainPanel = new JPanel();
  public void init () {
      MainPanel.setSize(300, 300);
      txtbox.setSize(60,20);
      btnStart.setSize(60,20);
      MainPanel.add(label1);
      MainPanel.add(txtbox);
      MainPanel.add(btnStart);
      add(MainPanel);
  } // init
}Anyone has an idea what I am doing wrong?

What output/result do you get from this code?
// <applet code="TestAppletLayout" width="300" height="100"></applet>
import javax.swing.*;
public class TestAppletLayout extends JApplet{
  JFrame fFrame;
  JLabel label1 = new JLabel("Label: ", JLabel.LEFT);
  JTextField txtbox = new JTextField(10);
  JButton btnStart = new JButton("Press Here");
  JPanel MainPanel = new JPanel();
  public void init () {
      System.out.println( MainPanel.getLayout() );
      MainPanel.add(label1);
      MainPanel.add(txtbox);
      MainPanel.add(btnStart);
      add(MainPanel);
      validate();
  } // init
}

Similar Messages

  • Why don't java applets run when using Firefox 4.0 in a windows limited user account?

    Java applications will not run in Firefox 4.0 when the windows user/process only has limited user access rights. The systems, I see this behaviour on have Windows XP Pro SP3, Firefox 4.0 and JRE 1.6.0_24 installed. The java application will run when when full administrative rights are present. This issue did not occur with the 3.6 firefox version that was previously installed.

    The problem also exists with the newer Firefox 4.0.1 and Java 1.6.0_25 versions.
    Enabling administrative rights resolves the issue ... though this defeats the purpose of using a limited user.
    The underlying bug appears to be in the Firefox java plugin detection code. The issue is related to the detection code requiring write access to the HKLM\SOFTWARE\mozilla.org windows registry key. The limited user only has read access for this registry key. The behaviour was identified using the Sysinternals ProcessMonitor utility ... showed firefox calling an interface to create the registry key and getting an access denied response in the limited user case.
    A more targeted workaround for the issue is to grant the limited user write access on the HKLM\SOFTWARE\mozilla.org windows registry key. This avoids the need to grant administrative rights to the user and enables the java plugin to be detected. That is, it works on the 2 XP systems where the java plugin wasn't being detected in limited user accounts.

  • Problems with jumping ball in Java applet

    The ball is supposed to jump to the same height from which it fell down, someway it always gets higher and higher. My question is why?
    import java.applet.*;
    import java.awt.*;
    public class Bug extends Applet implements Runnable
       private int y_pos = 200;
       private int y_speed = 0;
       private int radius = 20;
       private int appletSize_x = 400;
       private int appletSize_y = 400;
       private Image dbImage;
       private Graphics dbg;
       public void run(){
           while(true){
               y_speed++;
               if ((y_pos > appletSize_y)&& (y_speed > 0))
                    y_speed = (-1)*(y_speed);
               y_pos += y_speed; 
               repaint();
               //controls the time
               try{
                   Thread.sleep(20);
              catch (InterruptedException ex){}
        public void update (Graphics g){
            if (dbImage == null)
                dbImage = createImage (this.getSize().width, this.getSize().height);
                dbg = dbImage.getGraphics ();
            dbg.setColor (getBackground ());
            dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);//erase this line to understand better
            dbg.setColor(getForeground());
            paint(dbg);
            g.drawImage (dbImage, 0, 0, this);
        public void stop(){}
        public void destroy(){}
        public void start(){
            Thread th = new Thread(this);
            th.start();
        public void paint(Graphics g){
         g.setColor(Color.green);
         g.fillOval (30 - radius, y_pos - radius, 2 * radius, 2 * radius);
    }

    Shurik007.5 wrote:
    The ball is supposed to jump to the same height from which it fell down, someway it always gets higher and higher. My question is why?
    g.fillOval (30 - radius, y_pos - radius, 2 * radius, 2 * radius);There are variables here involved in what gets drawn, no? And do (some of) these variables change during the lifetime? Yes. So, there should be no question about why the display changes.
    Edit: I guess your question is more about "why doesn't y_pos keep cycling back and forth between the same two values?" I'd suggest you do some debugging, to make the computer tell you what the values are at each step until you understand what is going on. The simple answer is "It did what you told (programmed) it to do", of course.

  • OS X 10.6.8 using MOZILLA Firefox java applet plugin has crashed

    Hello everyone!
    I am running OS X 10.6.8 with the latest java plugins downloaded via software updates from Apple. 
    I am using Mozilla Firefox version 28.0. 
    I wanted to use a website (www.vectis.co.uk) to view a live bidding auction, but everytime I try to connect, it says that my 'java applet plugin has crashed'.  I have checked what version of java I have, it is 1.6.0_65 which I believe is the latest version.  The minimum requirement according to Vectis is version 1.6.0_35.
    I am using Firefox because Vectis states they do not support Safari.  My version of Firefox is the latest.  When I check the plugins via 'Firefox Tools -> Add-ons -> Check to see if your plugins are up to date' , it says that Java plugin is 'vulnerable' and I should obtain the latest version by going to Apple 'software updates' to ensure I have the latest version of java.  Why does Firefox not recognise the latest version of Java plugin from Apple?  I believe that for OS X 10.6, Apple provides Java plugin updates and there is no need to dowload anything further, so I am unable to install any other Java applet plug-in because they are supplied by Apple.
    Why does the java applet not work?? 
    This is killing me, please help!!
    Thank you
    Leila

    You might try looking/posting here.
    Firefox

  • Industry use for java applets?

    I have been writing an applet for my fantasy football league that uses a mysql database. I am doing this to learn java. My counselor from NC State referred me to some guy looking for a web programmer. He called me up and I was able to get him to come over to the house just a minute ago. His company wanted a website to be used only by his employees as they called customers and asked if they had any metal cutting equipment they wanted to sell or buy.
    He wasnt very computer savy but insisted the site be done with ASP or.NET.
    My question is this....
    Why would a java applet not suffice for this problem? I even offered to do it free for something to put on my resume(maybe this was my mistake). I am planning on learning JSP/J2EE very soon as I am almost finished my my applet.
    I am just wondering what would be the problem with doing this as an applet.
    I told him I could do it in a week as I know I could. Why do companies insist on using technologies they dont really need? Or am I not seeing something here? Any feedback appreciated...
    [email protected]

    Companies insist on using technologies that they don't really need for three reasons:
    1) (a good reason) They've already paid for some equipment or licenses and want to exploit those purchases. Introducing a new technology would require new expenditures. (This isn't applicable if the new technologies are free, of course.)
    2) (a good reason) Their current staff already know a particular technology, and so they insist on doing new work in that technology to reduce maintenance issues. If everyone at the company knows .Net and you do something in J2EE, then in the future any maintenance would require either training, or hiring an outside consultant to do the maintenance. This costs money.
    3) (the bad, but sadly most common reason) They're stupid. They read a sales pitch from Microsoft that says "J2EE bad, .Net good" and they believe it. Or they just love everything from Microsoft, because, gosh, doesn't everyone? Or they learn a tiny bit of information (".Net can be used to do things kind of like this") and refuse to consider anything else because that would reveal the tinyness of their knowledge.
    Though it's not clear to me from your description whether applets are the best solution either. Why does he need a web site at all for this? What will the application do? Why not use C++ or Flash/Actionscript, for that matter?

  • Some Java applets do not work after silent installation, solved by toggling "Enable Java content in the browser" - Why?

    We have about 1,800 workstations running Windows 7 (both 32-bit and 64-bit) running various versions of the Java JRE from 6 update 32 through 7 update 51.  Most are on 6 update 45.  We would like to standardize on Java 7 update 51 (32-bit) and get everyone updated to that version for security reasons.
    For the past two weeks, we have been having trouble with our installation pre-pilot.  What we are seeing is that our procedure successfully closes any open Internet Explorer windows and Java-related processes, uninstalls all old versions of the Java JRE, and then claims to have successfully installed Java 7 update 51.  The Java Control panel works.  We can even take Internet Explorer to Verify Java Version or Java Tester - What Version of Java Are You Running? and confirm that the Java applets on those sites are loading (though the latter only works after adding the site to the exceptions site list); however, when testers try to access our Kronos Workforce Central 6.3.10 system, the Java applets used by that system do not load.
    We have tried the following things, none of which worked:
    Clear Internet Explorer browser cache and cookies.
    Clear the local Java cache.
    Reboot the computer.
    Reset Internet Explorer settings, including personal settings.
    The one thing which does work is going into the Java Control Panel, going to the Security tab, unchecking "Enable Java content in the browser", pressing Apply, pressing OK on the pop-up window, checking the "Enable Java content in the browser" box again, pressing OK, pressing OK on the pop-up window, and then restarting Internet Explorer.  It is only after this point that all Java applets, including the ones used by Kronos Workforce Central 6.3.10, work.
    What I need to know is how I can automate the procedure of reinitializing the "Enable Java content in the browser" checkbox after installation or am I doing something wrong or missing a step in the automated installation that is causing this to happen?
    We are using Microsoft SCCM 2007 R3 to accomplish this upgrade, and everything is being run on the client machine using the SYSTEM account.  First, the PowerShell script "javaclean.ps1" is run, with part of the command-line process changing the PowerShell script execution policy to Bypass.  This script handles the closing of Java-dependent applications and Java processes and uninstalls old Java versions.
    javaclean.ps1:
    #Find all Java products excluding the auto updater which actually gets uninstalled when the main install is removed.
    write-host "Searching for all installed Java versions" -ForegroundColor Yellow
    [array]$javas=Get-WmiObject -query "select * from win32_Product where (Name like 'Java %' or Name like 'Java(TM)%' or Name like 'J2SE%') and Name <> 'Java Auto Updater'"
    if ($javas.count -gt 0)
        write-host "Java is already Installed" -ForegroundColor Yellow
        #Get all the Java processes and kill them. If java is running and the processes aren't killed then this script will invoke a sudden reboot.
        [array]$processes=Get-Process -Name "Java*" #-erroraction silentlycontinue
        $processes += Get-Process -Name "iexplore" #-erroraction silentlycontinue
        $processes += Get-Process -Name "firefox" #-erroraction silentlycontinue
        $processes += Get-Process -Name "chrome" #-erroraction silentlycontinue
        $processes += Get-Process -Name "jqs" #-erroraction silentlycontinue
        $processes += Get-Process -Name "jusched" #-erroraction silentlycontinue
        $processes += Get-Process -Name "jp2launcher" #-erroraction silentlycontinue
        if ($processes.Count -gt 0)
            foreach ($myprocess in $processes)
                $myprocess.kill()
        #Loop through the installed Java products.
        foreach($java in $javas){
            write-host "Uninstalling "$java.name -ForegroundColor Yellow
            $java.Uninstall()
    After this script is complete, SCCM calls a the VBS script "install.vbs" to perform the actual installation of Java JRE 7 update 51.
    install.vbs
    '* Script: Install JRE 7 routine
    '* Date:   3/14/14
    '* Author: [REDACTED]
    '* Rev:    1.0
    '* Notes: 
    '/// Common
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objWshShell = CreateObject("WScript.Shell")
    ' Get system architecture
    Dim colSys : Set colSys = GetObject("WinMGMTS://").ExecQuery("SELECT AddressWidth FROM Win32_Processor",, 48)
    Dim objSys
    For Each objSys In colSys
        If objSys.AddressWidth = 64 Then bolIs64Bit = True
    Next
    ' Get operating system
    Dim colOS : Set colOS = GetObject("WinMGMTS://").ExecQuery ("Select * from Win32_OperatingSystem",,48)
    Dim objOS
    For Each objOS In colOS
        If Left(objOS.caption, 20) = "Microsoft Windows 8 " Then
            bolIsWin8 = True
            WScript.Echo "win8"
        End If
        If Left(objOS.caption, 22) = "Microsoft Windows 8.1 " Then
            bolIsWin81 = True
            WScript.Echo "win81"
        End    If
    Next
    ' Set 32 bit program files directory
    If bolIs64Bit = True Then
        strPFILES = "Program Files (x86)"
        strSYSDIR = "SysWOW64"
        Else strPFILES = "Program Files"
        strSYSDIR = "System32"
    End If       
    ' Set windows directory
    strWIN = objWshShell.ExpandEnvironmentStrings("%windir%")
    ' Set the current directory
    strCurrentDir = objFSO.GetParentFolderName(Wscript.ScriptFullName)
    ' Set computer name
    strCompName = objWshShell.ExpandEnvironmentStrings("%computername%")
    '/// Main script
        '/// Install via .msi & capture exit code
        'intExitCode = objWshShell.Run("msiexec.exe /i """ & strCurrentDir & "\package.msi""" & " TRANSFORMS=""" & strCurrentDir & _
        '    "\transform.mst"" ALLUSERS=1 Reboot=ReallySuppress /qn", 8, True)
        'wscript.quit(intExitCode)
        '****RUN COMMANDS HERE****
        ' Create folder structure if it doesn't exist already   
        strFullPath = "c:\Windows\Sun\Java\Deployment" '
        ' How many levels are there in the path?
        nLevel = 0
        strParentPath = strFullPath
        Do Until strParentPath = ""
            strParentPath = objFSO.GetParentFolderName(strParentPath)
            nLevel = nLevel + 1
        Loop
        For iLevel = 1 To nLevel
            ' Figure out path for directory at level iLevel
            strParentPath = strFullPath
            For j = 1 To nLevel - iLevel
                strParentPath = objFSO.GetParentFolderName(strParentPath)
              Next
        ' Does this directory exist? If not, create it.
            If objFSO.FolderExists(strParentPath) = False Then
                Set newFolder = objFSO.CreateFolder(strParentPath)
            End If
        Next
        ' Kill running processes
        objWshShell.Run "taskkill /F /IM iexplore.exe", 8, True
        objWshShell.Run "taskkill /F /IM firefox.exe", 8, True
        objWshShell.Run "taskkill /F /IM chrome.exe", 8, True
        objWshShell.Run "taskkill /F /IM javaw.exe", 8, True
        objWshShell.Run "taskkill /F /IM java.exe", 8, True
        objWshShell.Run "taskkill /F /IM jqs.exe", 8, True
        objWshShell.Run "taskkill /F /IM jusched.exe", 8, True
        ' Copy deployment files
        objFSO.CopyFile strCurrentDir & "\deployment.config", "c:\Windows\Sun\Java\Deployment\", True
        objFSO.CopyFile strCurrentDir & "\deployment.properties", "c:\Windows\Sun\Java\Deployment\", True
        ' Disable UAC
    '    If bolIsWin8 Or bolIsWin81 = True Then
    '        objWshShell.Run "reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v PromptOnSecureDesktop /t REG_DWORD /d 0 /f", 8, True
    '        objWshShell.Run "reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f", 8, True
    '        objWshShell.Run "reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f", 8, True
    '    End If
        ' Install application
        intExitCode = objWshShell.Run("msiexec.exe /i """ & strCurrentDir & "\jre1.7.0_51.msi"" IEXPLORER=1 AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0 WEB_JAVA=1 ALLUSERS=1 Reboot=ReallySuppress /qn", 8, True)
        ' Enable UAC
    '    If bolIsWin8 Or bolIsWin81 = True Then
    '        objWshShell.Run "reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v PromptOnSecureDesktop /t REG_DWORD /d 1 /f", 8, True
    '        objWshShell.Run "reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f", 8, True
    '        objWshShell.Run "reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 5 /f", 8, True
    '    End If   
        wscript.quit(intExitCode)
        '/// Install via .exe on network
        'objWshShell.Run """" & strCurrentDir & "\Setup.exe"" -s -sms -f1""" & strCurrentDir & _
        '    "\setup.iss"" -f2""" & strWIN & "\Temp\Install-app.txt""", 8, True
        ' Need to turn off the open file security warning first
        Set objEnv = objWshShell.Environment("PROCESS")
        objEnv("SEE_MASK_NOZONECHECKS") = 1
    '    intExitCode = objWshShell.Run("""" & strCurrentDir & "\jre-7u45-windows-i586.exe"" /s /v""/norestart " & _
    '        "TRANSFORMS=""" & strCurrentDir & "\Tribe-jre7.mst""""", 8, True)
    '    WScript.Quit(intExitCode)
        '****RUN COMMANDS HERE****
        ' Then turn it back on
        objEnv.Remove("SEE_MASK_NOZONECHECKS")
    '/// Additional functions
    Help on this issue would be much appreciated!

    It turns out that this is actually a problem with Kronos Workforce Central.  We had the "site.java.plugin.CLSID.familyVersion" setting in that application set to "clsid:CAFEEFAC-0016-0000-FFFF-ABCDEFFEDCBA", which is the Java CLSID for Java 6.  After updating this value to "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" (the Java universal CLSID), this problem did not occur upon the automatic upgrade of Java.
    We have both Java 6 and Java 7 in our environment, and did during our Kronos implementation, so I don't know why we were using the Java 6 CLSID in the first place.
    Case closed!

  • Java Applet Certificate Signing Window comes up BLANK!

    Hi Everyone I have a problem where
    Java Applet Certificate Signing Window comes up BLANK!
    It comes up as blank gray panel with the java logo on the upper left.
    the title bar says "Java Plugin Security Warning"
    And I can't figure out what to do to make it come up properly. I tried double clicking it dragging it around to make it repaint itself nothing happens.
    I have tried clearing temp files deleting files from IE, deleting cookies, clearing the history.
    Now i'm going to restart the computer and see if it works.
    It is supposed to give me buttons.
    1. Accept for this session
    2. Grant
    3. Deny
    4. View Certificate
    But does anyone have any idea how to address this issue ?
    Stephen

    You might try setting the trace level to 5 in the plugin's Java console and looking what it spits out while the applet is launching. I remember seeing loads of information in there including stuff relating to certificate validation. It might be helpful.
    The trick to getting this info during start up:
    1) get the plugin to load by directing your browser to page with a known applet. Write your own little stub applet and load it or go to http://java.sun.com/. There's an applet on that page.
    2) bring up the plugin's console if it's not already and then go to a blank page.
    3) set the trace level to 5 in the console. (just press the 5 key).
    4) go to the page that launches your applet. You'll have tons of information pour out in your console.
    Happy hunting.

  • When Java applet invokes JavaScript which executes window.showModalDialog, get popup with about:blank

    When using a Java applet that invokes a Javascript function that in turn calls window.showModalDialog, a pop-up dialog that only contains "about:blank" results. Selecting "show desktop" from the Windows 7 taskbar and then viewing the FireFox window results in the true dialog content being displayed. Everything worked properly until very recently (and old versions of FireFox work) and I suspect something was changed in FireFox as a result of the recent Java security failures.

    Hello, I don't know about this specifically but this is what I would try.
    Instead of the string "\u7834\u70C2\u7269\u7A0B\u5E8F\u5458..."
    Set the encoding type in the String constructor first...
    ie:
    new String( "\u7834\u70C2\u7269\u7A0B\u5E8F\u5458...","GB18030");
    Here is a little class I whipped up to show the CharSets that are available to you..
    public class ShowAllCharSets
    ShowAllCharSets()
    Map myMap = Charset.availableCharsets();
    Iterator iterator = myMap.keySet().iterator();
       while (iterator.hasNext())
          System.out.println("Char set name = "+((String)it.next()));
    public static void main(String args[])
       new ShowAllCharSets();
    }Then use the preset charset String with the specific encoding already set for your menu items.
    GB18030 I picked arbitrarily because it is Chinese and you may have to try another.
    Good Luck!
    (T)

  • What is Java Applet 1.0, and why does it launch when I do an applet action?

    When I go to http://www.chemaxon.com/marvin/sketch/index.php with Safari 5.1.7 on MacOS 10.6.8, an applet launches.  If I then click and hold on one of the toolbars of this applet and drag to the left, the toolbar is supposed to detach.  Instead, my computer launches a program called Java Applet 1.0, and a blank rectangle appears where the toolbar is supposed to be, but no buttons appear in the toolbar.  The program Java Applet 1.0 does not appear to have any functions associated with it; if I click on its icon in my dock, the blank toolbar comes to he foreground, but nothing else happens.  If I quit Java Applet 1.0, the original applet quits as well.  A separate instance of Java Applet 1.0 launches for each browser that I use to go to http://www.chemaxon.com/marvin/sketch/index.php. 
    So my question is, what is the purpose of Java Applet 1.0?  Is Java Applet 1.0 launching because there is a bug in the applet, or is a bug in Java Applet 1.0 causing the applet to misfire? 

    I don't know this action, specifically, but such a message often means an action step has tried to do an activity that was successfully recorded with an image that has different attributes, e.g., RGB vs Grayscale, or maybe a different bit depth or other modal difference.  It's also possible you have a non-image layer selected when you're running the action.
    -Noel

  • Java Applet's Blank

    After the Java 2012-003 update for Lion, Java Applet's in Safari are blank or unresponsive. I'm not prompted for missing plugins or anything, it's simply non-functioning. I've enabled the Applet plug-in and Web Start applications, but it has no effect. In Chrome and Firefox, I am prompted to install missing plugins, but if I try to do so, it says that no plugin can be found and gives up.

    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ If you’re running Mac OS X 10.7 or later, open LaunchPad. Click Utilities, then Terminal in the page that opens.
    Drag or copy — do not type — the following line into the Terminal window, then press return:
    java -version
    Post any lines of output that appear below what you entered — the text, please, not a screenshot.

  • Java applet runs inside html page when opened with http, but no longer with "Open File" menu, why?

    Using the "Open File" menu, file:///Users/234866H/Documents/atom/atomic1.html fails to open the java applet atomic1.class inside atomic.html. However, http://atom.curtin.edu.au/igor/atom/atomic1.html works just fine.
    I suspect the problem arose following the recent java upgrade. It is also there on Safari.
    Testing Java at http://www.java.com/en/download/testjava.jsp yields:
    "Your Java is working. Your Java configuration is as follows: Vendor: Apple Inc. Version: Java SE 6 Update 51 Operating System: Mac OS X 10.6.8 Java Architecture: 64-bit"
    However, this is an http test, and not an "Open File" test.
    Any help would be appreciated.

    Hello, I don't know about this specifically but this is what I would try.
    Instead of the string "\u7834\u70C2\u7269\u7A0B\u5E8F\u5458..."
    Set the encoding type in the String constructor first...
    ie:
    new String( "\u7834\u70C2\u7269\u7A0B\u5E8F\u5458...","GB18030");
    Here is a little class I whipped up to show the CharSets that are available to you..
    public class ShowAllCharSets
    ShowAllCharSets()
    Map myMap = Charset.availableCharsets();
    Iterator iterator = myMap.keySet().iterator();
       while (iterator.hasNext())
          System.out.println("Char set name = "+((String)it.next()));
    public static void main(String args[])
       new ShowAllCharSets();
    }Then use the preset charset String with the specific encoding already set for your menu items.
    GB18030 I picked arbitrarily because it is Chinese and you may have to try another.
    Good Luck!
    (T)

  • Why is Safari on Windows XP treating Java Applets differently?

    Safari on Windows (and Mac) seems to load Java Applets differently. I review of the list of installed plugins shows both the Apple Java plugin and the installed java j2se 1.6_25 applet plugin to be handling the mime type for java applets. Does this mean java applets are loaded/deployed by the Apple plugin instead of the Oracle java plugin? Is there are work around such that I can make the applets behave the same on Safari as on, say, Mozilla.
    Examples of different behavior:
    1) ClassNotFound exception even though all jars and classes are in the classpath (loads fine on Mozilla)
    2) Malformed URL exception when running applets from Oracle tutorial pages.
    3) Javascript<->Applet communication does not work.
    Thanks
    Al

    Never got resolved, so we don't use Safari for Windows even still in 2009 b/c this site crashes Safari. But the site works on Mac Safari or Windows IE.

  • Why is it unable to read URL through Java Applet ?

    I have tried to read an image with ImageIO.read(URL) in JApplet. But it failed to be initialized. Please refer to TEST.java. But if I read the image in MSDOS mode, it works. Please refer to DisplayImage.java. The only difference is Applet and MSDOS mode.
    I am using WindowsXP with j2sdk1.4.1_01 installed.
    //File one: TEST.java
    //Please run in Applet mode
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.applet.*;
    import javax.swing.*;
    import javax.imageio.*;
    import javax.imageio.stream.*;
    import java.net.*;
    public class TEST extends JApplet
         BufferedImage tempimg;
         public void init()
              try
                   tempimg = ImageIO.read(new URL("http", "www.footprint.org.hk", 80, "/newsphotos/N200301270_0.jpg"));
              catch(MalformedURLException murle){}
              catch(IOException ioe){}
              JFrame f = new JFrame("ImageDisplayer");
              f.setSize(new Dimension(550,350));
              f.setVisible(true);
    //End of TEST.java
    //File two: DisplayImage.java
    //Please run in MSDOS mode
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.applet.*;
    import javax.swing.*;
    import javax.imageio.*;
    import javax.imageio.stream.*;
    import java.net.*;
    public class DisplayImage extends JApplet
         ImagePanel imagePanel;
         public static void main(String[] args) throws MalformedURLException, IOException
              DisplayImage img = new DisplayImage();
              img.init();
         public void init()
              //Display Image
              try
                   imagePanel = new ImagePanel(ImageIO.read(new URL("http", "www.footprint.org.hk", 80, "/newsphotos/N200301270_0.jpg")));
              catch(MalformedURLException murle){}
              catch(IOException ioe){}
    JFrame f = new JFrame("ImageDisplayer");
              f.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              f.getContentPane().add(imagePanel, BorderLayout.CENTER);
              f.setSize(new Dimension(550,350));
              f.setVisible(true);
    class ImagePanel extends JPanel {
    Image image;
    public ImagePanel(Image image) {
    this.image = image;
    public void paintComponent(Graphics g) {
    super.paintComponent(g); //paint background
    //Draw image at its natural size first.
    g.drawImage(image, 0, 0, this); //85x62 image
    //End of DisplayImage.java

    The security model for applets does not allow them to read from a URL unless it is on the same host the applet was loaded from. If you must do this then you must sign your applet for it to work.

  • Why does my Firefox say my java applet is corruped and will,not download for my game

    I play a lot of games on POGO and they tell me that I have to have JAVA and Mozilla Fire Fox for my browser. I have 1 game that I get kicked off of each time I try to play it. I get a notice telling me that my browser says my applet from Java is corrupted and will not download. I have done everything they suggest and nothing works. Mozilla seems to be a terriable choice for me as a browser I have a lot of ppproblems with them getting me to my web pages.. help!!

    Hi,
    Have you tried deleting the Java applet cache from the '''Java Control Panel''' > '''Temporary Internet Files''' > '''Settings''' > '''Delete Files...'''?

  • Why can't I install java applet for Google Drive. I am forced now to use Google Chrome. I did everything acc.to your instructions for add-ons.

    I am trying to upload maps into GoogleDrive. In Firefox I get the info that the java applet cannot be installed. After installing GoogleChrome it works perfectly.
    I did everything acc.to your instructions re. admitting add-ons, etc.

    There are other things that need your attention.
    Note that your System Details List shows multiple Flash plugins.
    # Shockwave Flash 12.0 r0
    # Shockwave Flash 11.9 r900
    You can find the installation path of all plugins on the <b>about:plugins</b> page.
    You can check the Flash player installation folder for multiple Flash player plugins and remove all (older) version(s) of the plugin (NPSWF32) and (re)install the latest Flash player.
    *(32 bit Windows) C:\Windows\System32\Macromed\Flash\
    *(64 bit Windows) C:\Windows\SysWOW64\Macromed\Flash\
    See also:
    *What should I do when I see a security prompt from Java?:<br />http://www.java.com/en/download/help/appsecuritydialogs.xml

Maybe you are looking for