Running a website in an java applet or frame

Hi ppl,
I was wondering if it is possible to run a website within a java applet or frame. I searched the web but cant find much information. Hope you can help me.
Thanks

I assume you mean to display web pages, like embed a browser in the application. You can use JEditorPane to display HTML pages, but it only supports HTML 3.2 and no Javascript. You can embed IE with a thing called IECanvas (have to search online for the link).
If you are doing so in an applet then there are issues with access to other sites or using things like IECanvas. So you'd need a signed applet. However, since the applet is in the browser anyway, you can always call getAppletContext().showDocument()

Similar Messages

  • Is it possible to run a website built in Java and applet from Safari browser in iPad

    Is it possible to run a website built in Java and applet from Safari browser in iPad?

    Java isn't supported on the iPad

  • Run Priviliged Code in a Java Applet

    I am calling a Java applet from Javascript. The Java code needs to run in privileged mode.  Eventually it is going to display a file chooser which will display files from the local hard disk, but for now it just returns a simple dummy value.  The problem I am having is that the call from JavaScript to Java returns PrivilegedActionException. The applet is in a signed Jar file.  I'm running 8u25.
    Here's the Java class:
        // Java code
        public class OHLib extends Applet {
            public String getFile() {
                String result;
                try {
                    result = (String) AccessController.doPrivileged(new PrivilegedAction() {
                        public String run() {
                            // JFileChooser code will go here
                            return "xxx";
                } catch (Exception e) {
                    e.printStackTrace();
                return result;
    Can anybody tell me what's wrong with this code?  I would also be interested to know why the above try/catch block is not catching the exception.  The only place I see the exception is in the browser F12 developer tools.
    Here's the JavaScript code:
        function BrowseForFile() {
            var x;
            try {
                 // this code generates PrivilegedActionException
                 x = ohApplet.getFile();
            } catch (e) {
                 console.log(e);
    The applet is deployed on my web page as follows:
    <script src="/plugins/deployJava.js"></script>
    <script>
         var attributes = {
             id:'ohApplet',
             code:'OHLib',
             codebase: 'java',
             archive: 'OHLib.jar',
             width:1,
             height:1,
         var parameters = {
          jnlp_href: 'OHLib.jnlp',
          classloader_cache: 'false',
         deployJava.runApplet(attributes, parameters, '1.8');
    <script>
    The applet is in a signed jar file, with the following manifest:
    Application-Name: <appname>
    Permissions: all-permissions
    Codebase: <domain>.dev <domain>.com
    Caller-Allowable-Codebase: <domain>.dev <domain>.com
    Application-Library-Allowable-Codebase: <domain>.dev <domain>.com
    The JNLP file is as follows:
        <?xml version="1.0" encoding="UTF-8"?>
        <jnlp spec="1.0+" codebase="" href="">
            <information>
                <title>title</title>
                <vendor>vendor</vendor>
            </information>
            <security>
                <all-permissions />
            </security>
            <resources>
                <j2se version="1.8+" href="http://java.sun.com/products/autodl/j2se" />
                <jar href="OHLib.jar" main="true" />
            </resources>
            <applet-desc
                 main-class="OHLib"
                 name="OHLib"
                 width="1"
                 height="1">
             </applet-desc>
        </jnlp>       

    The problem was that I was not including the anonymous inner class (OHLib$1.class) in the jar file. My original jar command looked like this:
    jar cfmv OHLib.jar "../../jar_manifest.txt" OHLib.class
    Changing it to below fixed the problem:
    jar cfmv OHLib.jar "../../jar_manifest.txt" OHLib.class OHLib$1.class
    Credits go to this page  for the solution.

  • On a Mac Java applets not working on FF 31, have not worked since FF26; how to fix?

    KeepVid, Quietube, Pin It, and placeholders on most websites instead of Java applets. Running Mavericks and Mountain Lion on an iMac and MacAir, and the applets don't work on either - they haven't worked since FF26. Plug-in is installed, and "always activate" in on. Anyone know what's going on and how to fix this?

    I know of two settings associated with Java, maybe we can start there?
    About:addons and then go to "extensions". Look for the Java plugin and make sure it is activated.
    After this you can go to the Java options to make sure that it is active and check if it is up to date here [https://www.mozilla.org/en-US/plugincheck/]
    [https://support.mozilla.org/en-US/kb/how-allow-java-trusted-sites How to allow Java on Trusted Sites in Firefox] may also be helpful.

  • Load Java-Applet in a Webpage

    Hi everybody
    I've got a Errormessage while I loading my Java-Applet!
    I want to load a website with a Java-Applet! Then I get this Errormessage...
    Java VM version: 1.4.2
    Java VM vendor: Sun Microsystems Inc.
    Class could not be loaded: gui
    Backtrace:
    java.lang.ClassNotFoundException: gui
    at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at org.kde.kjas.server.KJASAppletClassLoader.findClass(KJASAppletClassLoader.java:233)
    at org.kde.kjas.server.KJASAppletClassLoader.loadClass(KJASAppletClassLoader.java:274)
    at org.kde.kjas.server.KJASAppletStub$2.run(KJASAppletStub.java:163)
    at java.lang.Thread.run(Thread.java:534)
    I have the following files:
    ./java/files.jar
    ./java/files.jarContent
    ./index.html
    In the jar files are all needed class files!
    ./index.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>EMV-SW Client</TITLE>
    </HEAD>
    <BODY>
    <APPLET codebase="./java/" code="gui.class" archive="files.jar" height=595
    width=510></APPLET>
    </BODY>
    </HTML>
    What is wrong???? I haven't got a clue!
    Thanks for help...

    I've added this to my jar file... But i become the same errormessage!
    The problem is, that when I start the webpage on my localpc...
    file:/home/project/index.html
    Then it works perfectly! But when I start it from the Webserver...
    http://192.168.1.2/index.html
    I have the errormessage!

  • Problem facing when uploadin file thru java applet using WSA

    I am facing a issue, when I am trying to upload a pdf file on a website which uses java applet and WSA as proxy. On the java applet window when I select the file a click upload, it gives " Upload failed : java.net.Unknownhostexception ".
    On checking the issue in java console getting following error "SEVERE: java.net.UnknownHostException: www.mca.gov.in
    java.net.UnknownHostException: www.mca.gov.in
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(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 org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:86)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:652)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:628)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
    at javazoom.transfer.client.http.HTTPTransfer.headInfo(Unknown Source)
    at javazoom.transfer.client.http.HTTPUploadTransfer.dbupdate(HTTPUploadTransfer.java:973)
    at javazoom.transfer.client.http.HTTPUploadTransfer.run(HTTPUploadTransfer.java:155)
    at java.lang.Thread.run(Unknown Source)
    network: Connecting http://www.mca.gov.in:80/ with proxy=DIRECT
    29-Oct-2009 15:03:58 javazoom.transfer.client.http.HTTPTransfer headInfo
    SEVERE: java.net.UnknownHostException: www.mca.gov.in
    29-Oct-2009 15:03:58 javazoom.transfer.client.http.HTTPUploadTransfer run
    INFO: Upload failed"

    Done, what next ?
    Noah

  • Error while loading java applets

    hello,
    for some reason, whenever i try to open up a website using a java applet or even when I tried to download the latest version of jre, i get this error:
    Java Plug-in 1.6.0_18
    Using JRE version 1.6.0_18-b07 Java HotSpot(TM) Client VM
    User home directory = C:\Users\owner
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    load: class RedBlack.class not found.
    java.lang.ClassNotFoundException: RedBlack.class
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at sun.net.NetworkClient.doConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at java.net.HttpURLConnection.getResponseCode(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 7 more
    Exception: java.lang.ClassNotFoundException: RedBlack.class
    redBlack.class happen to be one particular applet i was trying to look at. it happens for all sites w/ java applets. Help is very much appreciated.

    I see this in the stack trace:
    Caused by: java.net.ConnectException: Connection timed out: connectIs it possible you're connecting through a proxy that filters out class files?
    Or maybe you're going through a proxy but haven't configured the JVM to go through the same firewall?
    Or something else like that?

  • JAVA applet not starting...am I missing other plugins?

    I dont know if this belongs in the Oracle Apps Server forum, but I've ruled out that it has nothing to do with my Apps Server, so I'm putting my question here...
    I am trying to deploy forms to my Oracle Apps Server on my UNIX server and am having some trouble. The forms run just fine when running from my client UNIX box, but when going to run on other boxes, the JAVA applet is not working. I'm running it using a Firefox Web Browser and it is saying that it needs to search and install an applet by going on the internet, but our unix boxes on our project are blocked from connecting to the internet. So...
    1) Are there any other browser plugins that forms requires other than a JRE?
    2) If not, is thre something that I need to do to my server?
    3) Are there other packages that need to be installed?
    I have went through and ensured that the java plugin is symbolically linked on the browser of the other unix boxes.

    By default JInitiator is used to run forms on the client. This is Oracle's JVM. I have not succeeded runing it within Firefox, but it works well with IE.
    You can try to edit your forms configuration (use the OEM). In "IE" parameter you will find the following instructions:
    System parameter: JVM option for Microsoft Internet Explorer.
    This parameter specifies how to execute the Forms applet under
    Microsoft Internet Explorer 5.x or above. Put IE=native if you want
    the Forms applet to run in the browser's native JVM.
    So you can try to put "native" and see if it will work with Firefox. As I said JInitiator does not.
    Good luck!

  • CONSTANT Java Applet Problems, HELP!

    Alright, since I've had my mac, Java has never worked properly. I have the latest version of OSX and of Java, I tried repairing permissions and also tried manually installing the latest OSX update, but whenever a website uses the Java Applet (for a game / chatroom, etc.) It will never load, or it will freeze the computer while attempting to load.
    I used to use Safari but now use Firefox.. Java doesn't work in either. This is a screen shot of what happens after a few seconds of waiting for this game to load:

    Several issues
    1) Don't paint in the JApplet itself. Instead paint in a JPanel and override its paintComponent method, not its paint method. In fact you would do well to create the GUI in this JPanel and then add the JPanel to the JApplet's contentPane.
    2) Don't override update and don't call update.
    3) The first line of your paintComponent(Graphics g) override should be a call to super.paintComponent(g)
    4) I would strongly urge you to not use NetBeans to generate your Swing code. By doing this, you're hampering your Swing education.
    5) You really shouldn't be adding a MouseListener to a JButton. Instead you add ActionListener's to buttons.
    Good luck and HTH

  • JComboBox shows "Java Applet Window" as last element

    Hey all,
    I am having a problem with using JComboBox. When I use JComboBox and show it in a JDialog (popup window), the last element of the drop down (JComboBox) is "Java Applet Window". This element is, however, not selectable. I want to get rid fo the "Java Applet Window" in my dropdown.
    This problem only happens when my applet opens up a JDialog that has the JComboBox, but does not happen when I add the JComboBox directly to the applet.
    I've read around in other forums that this has to do with security. I understand the need to show that a popup window (JDialog) is an applet window so the user doesn't mistake it as one of the native windows. But, the JComboBox is not a whole 'nother window, so why does it feel the needs to add that last line to designate it as a "Java Applet Window?"
    Thanks.
    Nina.

    My apologies, I did not clarify myself in my question. Sorry that I created misunderstandings of the problem - as evident in the response in the previous post from himanshug.
    I am using JDK 1.3.1
    I must use an applet, but all my components are standalone. They can be ran as a standalone application. But for deployment, we are using applets. It's easier to do applets so clients can access via browser than deploy a whole application installation on 50 machines halfway across the world.
    And no, there is no element in my list that says "Java Applet Window". When running my application standalone, the "Java Applet Window" does not appear as the last element in my drop down.
    The "Java Applet Window" also does NOT appear when I add the drop down directly to the applet. It only appears when the drop down is in a JDialog that gets launched by an applet.
    My problem: How to get rid of the "Java Applet Window" as it seems something is adding this to my dropdown. And it's not my code that is adding it.
    Thanks. I am also up'ing the duke dollars for a solution to this to 15.

  • Launching An Application From Java applet?

    is it possible to run an executable from a java applet (the executable could be in the local machine)? if it is not possible is there any other alternatives (like scripts)?

    Yes, it is possible but it violates the applet security rules. So you have to sign the applet for this to be allowed.

  • How to run a Java applet on a website.

    Hi,
    I am trying to run the code below [DrawLines.java|http://www.dgp.toronto.edu/~mjmcguff/learn/java/01-drawingLines/]
    import java.applet.*;
    import java.awt.*;
    public class DrawingLines extends Applet {
       int width, height;
       public void init() {
          width = getSize().width;
          height = getSize().height;
          setBackground( Color.black );
       public void paint( Graphics g ) {
          g.setColor( Color.green );
          for ( int i = 0; i < 10; ++i ) {
             g.drawLine( width, height, i * width / 10, 0 );
    on my website . I compiled it using JDK1.6.0_21 on Windows 7 and generated DrawingLines.class (My site is hosted on a linux server, is this an issue since it was compiled on Windows?)
    I created a html file:
    <applet width=300 height=300 code="/shanegibney/classes/DrawingLines.class"> </applet>Then I created a new folder called 'classes' in my public directory.
    I get the following error:
    java.lang.NoClassDefFoundError: /shanegibney/classes/DrawingLines (wrong name: DrawingLines)
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClassCond(Unknown Source)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.NoClassDefFoundError: /shanegibney/classes/DrawingLines (wrong name: DrawingLines)I'm sure adding a java applet is very common. Does anyone have any ideas why this isn't working? It can be seen here .
    Any help would be greatly appreciated,
    Thanks,
    Shane
    Edited by: ofey on Jul 9, 2010 4:21 PM

    I believe it's interpreting some of the code attribute as a path. Try this:
    <applet width=300 height=300 codebase="/shanegibney/classes/" code="DrawingLines"> </applet>

  • Can't get java applet to run on IE 6.0

    I have just installed j2sdk1.4.0 and I am trying to get the HelloWorld example to run. I can get it to run on appletviewer but when I run in on IE 6.0, I get the error message
    Error loading class: HelloWorld
    java.lang.ClassFormatError
    java.lang.ClassNotFoundException: HelloWorld
    I have tried other java applets from various websites and they work.
    Can anyone please help me?

    Download and Install Java Plugin and Use the OBJECT tag instead of the APPLET tag.

  • I can not open java applet on a certain website. started about 4 days ago.

    == Issue
    ==
    Firefox is having problems with certain web sites
    == Description
    ==
    i am no longer able to open the first 4 webcams on this website. this started about 4 or 5 days ago. i also have a macbook that is running the same firefox and i can open them on that computer. i can open the webcams if i open them under the safari browser. i am running version 3.6.3 on mac os 10.6.3 thanks
    == URL of affected sites
    ==
    http://www.colorado-west.com/cooke/
    == Troubleshooting information
    ==
    java embedding plugin 0.9.7.2 mrj plugin 1.0 jep 0.9.7.2
    == Firefox version
    ==
    3.6.3
    == Operating system
    ==
    Intel Mac OS X 10.6
    == User Agent
    ==
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
    == Plugins installed
    ==
    *-Gecko default plugin
    *Runs Java applets using the latest installed versions of Java. For more information: Java Embedding Plugin. Run version test: Java Information.
    *iPhoto6
    *Garmin Communicator Plug-in Version 2.8.2.0
    *3.0.50106.0
    *The Google Earth Plugin allows you to view 3D imagery and terrain in your web browser.
    *The Flip4Mac WMV Plugin allows you to view Windows Media content using QuickTime.
    *Shockwave Flash 10.0 r42
    *The QuickTime Plugin allows you to view a wide variety of multimedia content in web pages. For more information, visit the QuickTime Web site.

    Try to reload those web page(s) and bypass the cache.
    * Press and hold Shift and left-click the Reload button.
    * Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    * Press "Cmd + Shift + R" (MAC)

  • Issue with running Java applets on Safari 6.1

    I conducted a system capability check on the course site I access (Defense Acquisition University) and one of the results indicated that I do not have the capability to run applets (requirements to run all courses).  I verified my setings and I do have Java ver. 7 update 45 installed.  I verified Safari's security preferences and confirmed that the "Enable Java Script" is checked.  I tried configuring the website settings for Java plug-in but cannot figure out how to add url on the configured websites box.  Is there any way to enable running applets in Safari?  Any help is appreciated.  Thanks in advance.

    Please post a link to the page you're having trouble with (unless it requires a password.)

Maybe you are looking for