Putting an applet in a web page

My applet connects to an Oracle database and when ran gets the following error:
java.security.AccessControlException: access denied (java.net.SocketPermission oracle.isg.computing.dcu.ie resolve)
Is it possible to run this without changing the java.policy file

you don't need to buy a certificate - you can just sign the JAR your applet is in with the jarsigner tool that comes with the sdk
you first need to use keytool to create a key (which it will store somewhere on your machine) - and you enter details like your name and company name which will appear in a dialog when your applet tries to launch
it says something like "this applet is signed by Your Name Here - do you still want to run it?"
the internet pages on keytool make it look complicated - which to be fair it probably is - but i've managed to use it for simple things (using webstart rather than applets)
http://mindprod.com/jgloss/keytool.html
I think if you just type "keytool -genkey" it might run through what you need to input one item at a time (there is a command line to do this but I can't remember what it is - sorry)
asjf

Similar Messages

  • Trying to add a simple applet to a web page

    Well, I was trying to add a simple applet to a web page(php nuke Home section), it didn't fin my applet, so I changed it and added it to a simple html file to make it as simple as I could get it.
    This is the code in the html file:
    <applet code="usblock.class" width="400" height="400">The browser doesn't support applets...</applet>The directory: www/usblock.html & www/usblock.java & www/usblock.class - As you can see the files are all in the same directory/folder.
    usblock.java code:
    import javax.swing.*;
    import java.awt.*;
    public class usblock extends JApplet
         public void init()
              JPanel p = new JPanel(new BorderLayout());
              p.add(new JLabel("Heisann"));
              add(p, BorderLayout.CENTER);
    }now as I open the html local on my computer, it workes. As soon as I open the usblock.html from my website, it doesn't.
    It gives me this error here:
    load: class usblock.class not found.
    java.lang.ClassNotFoundException: usblock.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 moreSo I thought it was that it couldn't find the .class file. Well, I went through the How To add applets that I found somewhere on sun.com. It had exactly the same as I had.
    Im figuring the problem is something easy and not hard to detect. But my eyes can't find it somehow. This is my second time trying applets, and I kinda forgot how I got it to work the first time.
    Im just glad for all the help I can get.
    Thanks a lot.
    LordSvae
    PS: Sry for the size of the post, but I'm not sure how much info I was supposed to put in here, so I thought the more the better, right? :S

    Hii,
    I doesn't know the solution but same kind of problem is come with me & I found that the problem is of Path i.e. you need to set a codebase attribute . For tempory solution what i do i simply copy the .class file in to html file dir.

  • LookAndFeel issue reloading an Applet in a Web page

    Hey all,
    I have an Applet that runs on a web page (loaded by servlets and JSP's using Tomcat 3.2.1 and Apache). I created my own LookAndFeel class and have a static function in the applet that sets the LookAndFeel to my new class. Everything works fine when the Applet is first loaded. However, when you exit the applet and then reload it, the custom LookAndFeel is gone and all I get is the default Metal. If I load the applet with appletviewer, I can reload it as much as I want and it always loads my LookAndFeel class.
    The static function is as follows
    /** Static initializer to set the LookAndFeel
    static {
    try {
    UIManager.setLookAndFeel(new MyNewLookAndFeel());
    catch (Exception e) {}
    I do not get any exceptions and like I said, everything works great when loaded with appletviewer.
    I have tried adding the SwingUtilities.updateComponentTreeUI(this); in either the start(), init(), or my own createGUI() function and it still does not work.
    Any ideas? Could this be a problem with the browser caching the applet? I am using IE 5.50.

    I have the same problem
    putting them in static doesn't keep the look and feel
    putting them in the applet constructor does'nt keep it
    putting them in init() doesn't keep it
    putting them in start() doesn't keep it
    heck, even putting them in all 4 of them together doesn't keep the look and feel, it always reverts back to metal

  • Applets in local web pages using IE

    In IE SP2 you cannot view local (hard drive) web pages that contain scripts without answering a lot of questons. To get around this you can put th so-called 'Mark Of the Web' in the HTML and presto! Javascript scripts now run. BUT Java applets still do not. They silently fail to load .
    Without thread-creeping off into flames against MSFT, does anyone know how to work around this?

    Chk this.
    Web Page Composer – how easy it is to create and publish a web page (Part III)
    Regards
    Manisha

  • Embedding a j3d applet into a web page

    My students have just created a new zealand tourism jsp web page using JBuilder2006 struts with tiles framework and have also created a j3d applet with an animated logo. We wish to embed the j3d graphic on our opening jsp page. We have tried the depracated <applet> tag and also now we are trying the <object> </object > tag.
    <OBJECT codetype, classid,width,height,codebase,archive ></OBJECT>
    We just get a black empty frame were the graphic should be despite our best efforts.
    How do we embed j3d graphics on web pages, is it that difficult.
    Anyone out there help or point us in the right direction.
    We are so near and yet so far.
    Regards form New Zealand
    John (Tutor)

    I think this still works. Just change the names and parameters.
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = 800 HEIGHT = 800 ALIGN = middle  codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
    <PARAM NAME = CODE VALUE = "AlternateAppearanceScopeTest.class" >
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.2.2">
    <PARAM NAME="scriptable" VALUE="false">
    <COMMENT>
    <EMBED type="application/x-java-applet;version=1.2.2"  CODE = "AlternateAppearanceScopeTest.class" WIDTH = 800 HEIGHT = 800 ALIGN = middle  scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED></COMMENT>
    <blockquote>
    <hr>
    If you were using a Java-capable browser,
    you would see Hello Universe! instead of this paragraph.
    <hr>
    </blockquote>
    </NOEMBED></EMBED>
    </OBJECT>regards

  • Focus issues between Applets on a web page

    I have a web page that contains two applets(A1 and A2) each containing a JTable with editable cells.
    If I click on an editable cell in the table in applet A1 so this I can change it and I then click on an editable cell in the table in applet A2, I now have both cells available to edit.
    This is not the intent as I would like the focus to shift from A1 to A2 and editing stop on A1.
    I have tried a focusListener on the applet but that never seems to get called.
    Does anyone have an example of how to accomplish this?
    Jim

    I will try the newer SDK.
    Could you offer an example of how to setup the focusListener given the an applet declaration of:
    public class SimpleTableApplet extends JApplet {
        public void init() {
        public void foobar() {
    }and so forth.
    I would prefer not chasing phantoms.
    Thanks,
    Jim

  • Getting applets into a web page

    I am trying to learn about Java Applets from a book, after having done a little programming at college.
    My problem is that the books first example (�Watch�) works fine when viewed through an appletviewer, but when I try to add it to a web page I get a �load: class Watch not found� error in IE. The Watch CLASS file is in the same directory as the Html file, so I cannot see how it is unable to find it.
    My only thoughts are that my IE doesn�t support Java2 and that some part of the coding falls into this category. Is it possible to check if my IE supports Java2, and if not, is there a pluggin for it?
    As this is a simple program I�ve included all my coding below.
    Watch class:
    import java.awt.*;
    import java.util.*;
    public class Watch extends javax.swing.JApplet {
    private Color butterscotch =new Color(255, 204, 102);
    private String lastTime = "";
    public void init() {
    setBackground(Color.black);
    public void paint(Graphics screen){
    Graphics2D screen2D = (Graphics2D)screen;
    Font type = new Font("Monospaced", Font.BOLD, 20);
    screen2D.setFont(type);
    GregorianCalendar day = new GregorianCalendar();
    String time = day.getTime().toString();
    screen2D.setColor(Color.black);
    screen2D.drawString(lastTime, 5, 25);
    screen2D.setColor(butterscotch);
    screen.drawString(time, 5, 25);
    try{
    Thread.sleep(1000);
    }catch(InterruptedException e){ //do nothing
    lastTime = time;
    repaint();
    HTML Page:
    HTML>
    <HEAD>
    </HEAD>
    <TITLE>WATCH APPLET</TITLE>
    <BODY>
    <APPLET
         code     = "Watch.class"
         width     = "345"
         height     = "50"
         >
    </APPLET>
    </BODY>
    </HTML>

    normally the Java Plugin is installed when you install
    the JDK.
    have a look at your Internet Settings (in IE):
    in the tab "Advanced" there should be an item called
    "Java (Sun)" (normally located directly over the item
    "Microsoft VM")Since installing JDK I have upgraded from 98SE to XP, if "upgraded" is the correct word.
    Just the "Microsoft VM" options ...... no mention of "Java(Sun)".
    Is there some way I can reinstall the plugin?

  • Hoe to deploy an RTP receiver applet on a web page?

    Hi... I am currently dealing with the RTPPlayerApplet that is embedded in a web page...
    However, i have the following errors when viewing the page...
    [Thu Jul 07 11:03:39 2005] [error] [client 127.0.0.1] File does not exist: C:/Apache-2.0.05/Apache2/htdocs/mystuff/MyTESTing4/media
    [Thu Jul 07 11:03:41 2005] [error] [client 127.0.0.1] File does not exist: C:/Apache-2.0.05/Apache2/htdocs/mystuff/MyTESTing4/jmfsample
    [Thu Jul 07 11:03:43 2005] [error] [client 127.0.0.1] File does not exist: C:/Apache-2.0.05/Apache2/htdocs/mystuff/MyTESTing4/javax/media/rtp/RTPSessionMgr.class
    Isit because i did not set the classpath for it? Or i stil need to custimize the .jar file?
    Can anyone help me to solve it?
    Thanks in advance.
    CArter

    I wish I could help you but this sample file is very out of date. I found the RTPPlayerApplet class and when I tried to compile it I found that half of the classes use have either been deprecated or don't even exist anymore. My advice is to try another sample.

  • Info from applet back into web page?

    I know that information can be passed to an applet via <param> tags, but can information be passed back to the page from an applet, perhaps to a javascript or php function?

    Well, you can call JS-Methods using liveconnect and the JSObject Interface
    Note that the browser has to support this which is often not the case. However IE and mozilla should be fine most time.
    have a look at docs for more info

  • Is it possible to run an applet inside a web page using JDeveloper?

    Have they got around to that yet?
    Owen Brandon

    Not sure who "they" are?
    Yes, it's possible. Did you try googling "jdeveloper applet?"
    You'd find [url http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3?topic=run_p_applet_html]this if you do...
    Regards,
    john

  • Please help. Start a client application (not applet) from a web page.

    Hi,
    It may be very simple, but I can not find it quickly.
    Anyone can give me an example page that can start an application by click something.
    Thanks very much.

    Hi,
    This works on my PC (of course it's not portable to all clients)
    <HTML>
    <BODY>
    Click here to start notepad
    </BODY>
    </HTML>

  • How do I put a link to an imix search on a web page

    I want to put a link on a web page to a search for every imix with IHDA in the title.
    how do I do that?

    Right-click the title of the iMix, and choose "Copy link." Paste it where you want it. You will get something like this:
    http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewIMix?id=363873831&s=143441

  • Applet works fine with JNLP... but not on my web page

    I can create a seperate JNLP for my applet, and it works fine. However, when I try to insert it into a web page, it does not work. I was wondering if this was a common newbie issue, and how I would go about fixing it. I compiled it using the newest J2EE JDK and the newest JSE (downloaded and installed a couple of weeks ago).
    Any help would be greatly appreciated... thank you.

    If you want to insert an applet in a web page you use java plug-in, not java web start. You can use Java Web Start to deploy an applet outside of a browser, but plug-in is still the primary applet deployment method, and the only one that can show an applet in a web page.
    /Andy

  • Can applet pass value back to web page?

    if i run an applet in a web page, eg: aspx
    is it possible for me to pass value back to the page?

    if say i'm playing a maze, which written in applet.
    and the applet is run under a web page.Lika applets usually are.
    at the time i solve the maze, it will show a
    messagebox,
    at the beginning, i plan to write a solving data
    fileto the disk, but later i found out applet doesn't
    allow writing of file.It does. You just need to sign it.
    so i would like to pass the data value back to the
    web page, when i click the ok button on the message
    box.You didnt' answer my question. Web pages are HTML and don't accept data, so your question as it is makes no sense.
    pass back an integer value which store the solvign
    time.If you want to talk to Javascript, see my previous post about using Google to find out how. It's often-documented.

  • Inserting applets in web pages using object

    Hello,
    I'using the following code to insert an applet into a web page:
    <object codetype="application/java"
    classid= "java:javalandia.FaddingImageBanner.class"
         width     = "105"
              height = "66">
    <param name="config" value="images.xml" />
    </object>
    this works well in every browser I've tried (Opera, mozilla, netscape, k-meleon, firefox,...) but not with Internet Explorer. If I use the <applet> tag it does work, but then I can't validate the page as XHTML1.1
    Can you help me with that?

    The Java Plugin Developer's Guide for the Java version you use has infromation about the use of the object tag.

Maybe you are looking for