Custom FocusManager in Applet

Hi,
I created an applet that contains a JTable. To control the keys pressed I created a custom FocusManager. Instead of jumping to the next cell in the JTable I add a new line to the content of the table when RETURN is pressed. I didn't find any other ways to achieve this behavior. Anyway, running the Applet gives the following restriction:
java.security.AccessControlException: access denied (java.awt.AWTPermission replaceKeyboardFocusManager)
Does anyone know if it�s possible to avoid this restriction or knows a workaround for the Focusproblem?
Hans

Signing the applet or modifying your java.policy file will probably solve the problem.

Similar Messages

  • Custom classloader in Applet?

    Hi
    I have for some time tried to load an Applet from within an Applet by means of custom classloader.
    However when reading various specifications for classloader they state it is not possible for an Applet to do so.
    Does anyone know otherwise?

    Hi
    To be more specific.. I have 2 Applets yes. In the first signed Applet I run as a jar I have created a custom classloader that extends ClassLoader hence the java bytecode I wish to load (also an Applet) must be (a) class file(s). As far as I know the ClassLoader is not able to define classes from jars right?
    It is only the loading Applet that is packed as a jar and there is no nested jars. However the loaded Applet is now loaded as a class file but I would like to load is a jar for speeding up loading time.
    Quote from http://www.javaworld.com/javaworld/jw-10-1996/jw-10-indepth.html:
    There is a cost, however, because the class loader is so powerful (for example, it can replace java.lang.Object with its own version), Java classes like applets are not allowed to instantiate their own loaders. (This is enforced by the class loader, by the way.) This column will not be useful if you are trying to do this stuff with an applet, only with an application running from the trusted class repository (such as local files).

  • About Jcop'custom mask applet into rom.

    How can I use JCOP's sim to custom mask a applet into rom.and how can i debug the applet.when i debugged,i allways get"Erron connecting to VM!"
    Help me.
    Thanks

    You can't debug an applet in ROM with JCOP Tools.

  • Signed applet runs in Firefox but not in Internet Explorer

    I've signed an applet with
    keytool -genkey -validity 3650 -keyalg rsa -alias ddkey
    keytool -export -alias ddkey -file ddcert.crt
    jarsigner planner.jar ddkey
    jarsigner -verify -verbose -certs planner.jar
    but loaded from the webserver with...
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>Planner </TITLE>
    </HEAD>
    <BODY>
    <APPLET CODE="mypack/Planner.class" ARCHIVE="planner.jar" WIDTH="100%" HEIGHT="100%">
    <PARAM name="customer" value="mycustomer">
    </APPLET>
    </BODY>
    </HTML>
    .... the applet only works with firefox and not in Internet Explorer. Even with a new certificate, IE does not ask me whether I trust the applet or not. Only a blank screen with a red cross..
    In spite of having configured "show Java console", the Java console is NOT opened in the task bar, so I cannot add further log messages....
    Why do the two browsers behave differently?? How can I fix it?
    Appreciate any hint :-)

    When I see "it doesn't work in IE" I always have to ask: Windows 7? 64 bits system? Are you sure you are running this in the 64 bits internet explorer? The default IE is the 32 bits version, so if you don't have a 32 bits Java runtime installed applets are not going to work at all, signed or otherwise.

  • Code sharing between applets

    Hi,
    I'm currently using Eclipse and JCOP plugin for applet development, and I'm looking for solutions on how to share custom libraries between applets. I'm particularly not looking for interface sharing between applets, but more how to organize the source code so I can include common custom classes in different applets (e.g. generic ASN1 parsing library, signature library etc)
    Thank you for any feedback.

    Thanks for the pointer! I also found this thread:
    https://forums.oracle.com/thread/2217928?start=0&tstart=0
    which cover the same topic with code examples to be very useful.
    But I have stumbled upon a couple of problem wrt this approach which I can't quite isolate:
    1. I've got a shell script which basically "tags" a package before build with the SVN version number, and if there are local modifications. This code is auto-generated in a file called svnversion.java inside commonlib package:
    package commonlib;
    public class svnversion {
      public static final byte[] TAG = {(byte) 0x00 ,(byte) 0xFB ,(byte) 0x3F } ;
      public static final boolean MODIFIED = true ;
    When this code was in the same package as the applet, I had no problem accessing the TAG byte array, but after separating the applet and the commonlib in two separate packages, I get SW 0x6f00 whenever I touch the TAG byte array from my applet. I can access the MODIFIED variable, but not the TAG byte array.
    (EDIT: Since commonlib declare TAG as a static final byte array, and final cannot be set to null upon release, maybe this is the cause for my memory leaks?)
    2. I try to keep everything in commonlib static, and I've added an install() and release() hook in commonlib which keeps track of reference counter and acquire and release memory. Upon release I set every static variable to null. And I call commonlib.install() from the applet, and use AppletEvent and do commonlib.release() upon uninstall. But still it seems I fail to clean-up properly, because I end up in situations where I'm unable to delete the card content - presumably because a memory leak. So I have a few questions related to that:
    a) How do I debug memory leaks?
    b) In commonlib, if I do:
    public class Common {
         private static DESKey des1Key = null;
         private static short refCount = 0;
         public static void install() {
              refCount++;
              if (des1Key == null)
                   des1Key = (DESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES, false);
    public static void release() {
         --refCount;
         if (refCount == 0)
              des1Key = null;
    Is it a correct assumption that I need to set des1Key to null, because it is declared as static?
    c) Does the following code snippets allocate memory, which needs to be freed?
    md = MessageDigest.getInstance(MessageDigest.ALG_SHA_256, false);
    and
    rsaCipher = Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);
    d) Say commonlib should hold one RSA key, but at install time we do not know the key size (actual size shall be requested by client). I chose this approach:
    public class RSAlib {
         public static KeyPair rsaKeyPair = null;
         public static Cipher rsaCipher = null;
    private static short refCount = 0;
         public static void install() {
    refCount++;
              if (rsaCipher == null) {
                  rsaCipher = Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);  }
         public static void release() {
              --refCount;
              if (refCount==0) {
                   rsaCipher = null;
                   rsaKeyPair = null;
    public static void createRSAKeyPair(short keySize) {
         switch(keySize) {
         case (KeyBuilder.LENGTH_RSA_1024):
         case (KeyBuilder.LENGTH_RSA_2048):
              break;
         default:
              ISOException.throwIt(SW.CRYPTOGRAPHIC_ERROR);
         try {
              JCSystem.beginTransaction();
              rsaKeyPair = new KeyPair(KeyPair.ALG_RSA_CRT, keySize);
              JCSystem.requestObjectDeletion();
              JCSystem.commitTransaction();
         } catch (Exception e) {
              JCSystem.abortTransaction();
    Is this correct usage of garbage collection (I know my JCOP card support it), and will this work in context of a commonlib?

  • Applet accidentally requests Java Core API classes from network

    Hi,
    starting an applet from a customers client machine (IE7, Windows XP, Standard JRE Installation of Java 1.6.0_26), I see in the tomcat access log entries signalizing that core java api classes are accidentally requested from the server:
    "GET /mywebapp/applet/java/lang/StringBuilder.class HTTP/1.1" 404 1156 0
    "GET /mywebapp/applet/javax/swing/JPanel.class HTTP/1.1" 404 1141 0
    "GET /mywebapp/applet/java/net/JarURLConnection.class HTTP/1.1" 404 1162 0
    "GET /mywebapp/applet/java/util/jar/JarEntry.class HTTP/1.1" 404 1153 0
    "GET /mywebapp/applet/java/util/jar/JarFile.class HTTP/1.1" 404 1150 0
    Although tomcat responses with HTTP 404, the applet works fine.
    Questions:
    1. For me, it looks like a security risk when the browser tries to load system classes from the network instead of using the local files from the jre dir, doesn't it?
    2. When starting the applet from my local machine (different network), no tomcat logfile entries are generated. An interesting fact is, that in the customer network, the applet "codebase" parameter in the HTML source gets modifed by a proxy server for whatever reason like the following:
    <applet codebase="http://mydomain.org/mywebapp/applet">
    becomes some kind of:
    <applet codebase="http://mydomain.org/mywebapp/applet/+sgrkjkrlgjklJKLjekrr4jewlkfjkerlkrelkjgregkjerlkgljkeglkjgjelkLKJLKefjei55435ijjkl=+">
    It seems that such codebases confuse the classloader. Any ideas about that?
    Thank you so much for any hints!

    <applet codebase="http://mydomain.org/mywebapp/applet">
    So you're loading individual .class files from the codebase? Don't do that, put them into a JAR and specify the JAR file(s) as the codebase. Much more efficient and it may solve this problem too.

  • Segmentation Error : Server returned HTTP response code: 500 for URL

    Hi,
    when we do customer segmentation in Applet Java Builder, we create a target group using 2 or more criterion, then it prompts us an error "Communication Error" - Server returned HTTP response code: 500 for URL: http//xxxxxxxxxxx/bc/bsp/sap/CRM_MKTTG_SEGAP/communication.do
    we're in CRM 7.0 SP 6.
    What we have done
    - activated the service CRM_MKTTG_SEGAP
    - implement sap note 1481289, 1359890, 1161753
    any info is really appreciated.
    Thanks
    JD

    HI ,
    Communication error occurs because of two active versions of segment builder jar files are appearing , deletion of older version resolves this issue .
    Go to SE80 u2013 Select the BSP Application - CRM_MKTTG_SEGAP and check segmentbuilder.jar Segment Builder Applet under MIME folder and check the size and delete the older version .
    Regards,
    Satish Bondu

  • Open local application via KM-Link

    Hi there,
    we have a customer who uses a custom developed signed applet to open local applications in a IBM Websphere Portal. The links can be removed/modified/deleted by the end user. Is there a way to use such a applet in combination with KM-Links? Can I specify a file extension in the KM which automatically calls a portal service (which contains the applet)? I don`t think a conversion of the IBM-portlet is possible (or worth doing it) cause it uses own database tables etc.
    Thanks & regards, Jens

    Hi Jens,
    One option you might look at if you can't get it going
    with external links is to is creating an XML Forms
    project where the user can enter the the file path. The
    path could be stored in the schema. Then on the show
    form you could have a link or button to start the
    applet, although you might have to tweak the XSL to get
    what you want (i.e., pull in the static part of the
    href). I don't know if this is a tenable solution for
    you, but it might provide another area to look at if you
    can't pull it off with just external links.
    In other words, you could hack up a basic XML Forms
    project to get what you want, although you have to be
    careful not to ever edit the project with the forms
    editor again since that might overwrite your changes.
    Regards,
    Darin

  • Custom Loading Screen in Applet

    Hello,
    in Flex/Flash the swf File contains 2 parts. First the loading Screen and second the programm.
    So it loaded the loading Screen and than contains with the loading of the programm.
    You can override the common Loading Screen and add some company specific varaint. The is very usefull, cause many company have a own CI.
    So it is possible to change the Loading Screen in Java FX Applets?
    Thanks for you Answer.
    Regards,
    Rookee

    See [Joshua Marinacci's Blog: A Better Applet Experience, Part 1: a custom loading screen|http://weblogs.java.net/blog/joshy/archive/2008/08/a_better_applet.html] article.
    But I fear we are currently limited to an image, fixed or animated (Gif). We cannot do something fancy like a lightweight FX program showing a more or less complex animation while the heavyweight applet loads in background (and provides progress information...).

  • Forms applet does not load when request forwarded from custom servlet

    I have an existing forms app that I wish to call from a newly-developed servlet. The servlet determines which form to call and then forwards the request to the forms servlet using RequestDispatcher.forward().
    The request is forwarded correctly but when it is done all I see is a blank browser (IE7) window. When I View Source I see all the correct HTML code (from basejpi.htm) but it seems my browser does not attempt to load the forms applet. No messages are displayed in the Java Console. This is the same HTML that comes back if I run the forms app directly, e.g. click a link that goes straight to the forms servlet URL, only in that case the forms app starts up fine.
    Anyone know why this does not work?

    Figured out what is going on:
    In basejpi.htm there is "<SCRIPT LANGUAGE=JavaScript SRC=java/forms_ie.js>" that creates an OBJECT tag to load the forms applet. I believe since the context of my custom servlet is different than that of the forms servlet, forms_ie.js is not found when the request is forwarded from my servlet.
    One question answered raises another. There is also an OBJECT tag inside a NOSCRIPT tag for machines where scripting has been disabled:
    <!-- Forms applet definition (start) -->
    <NOSCRIPT>
    <OBJECT name=FormsApplet
    type="application/x-java-applet"
    ...>
    </NOSCRIPT>
    <SCRIPT LANGUAGE="JavaScript" SRC="java/forms_ie.js"></SCRIPT>
    My thinking is to remove the NOSCRIPT tag, and also the SCRIPT tag mentioned above, so all machines will simply see the OBJECT tag, like so:
    <!-- Forms applet definition (start) -->
    <OBJECT name=FormsApplet
    type="application/x-java-applet"
    ...>
    This makes me wonder why the SCRIPT option is there to begin with. Anyone see a downside to this approach?
    Kevin

  • Global Web Applets and My Custom Home Page Report

    Hello,
    I setup a custom "My Home Page Report" which is great but does not display the report when you load the home page without clicking the "Generating analysis... Click here to view the results" link. Is there a way around this?
    I then setup a a Global Web Applet and embedded this on the main home page. When doing this I found you cannot have 1 section that spans the entire width of the page as you can with a report (To my knowledge?). I then tried putting two Custom Web Applets side by side to display the graph and report I wanted. This works however, I have vertical scroll bars although the reports are perfectly displayed and do not require any scrolling. Is there a way to get rid of the scroll bars?
    Regards
    Innoveer

    Innoveer, you can contact customer care and ask them to provision your On Demand application with the custom homepage "Execute Report Immediately" option. However, you want to make sure that this custom report loads quickly - if not it will delay the loading of your homepage.

  • Custom applet class loader, how?

    Fellow Java programmers;
    I would like to load 'secure' class files (ie encrypted) into an applet at startup time.
    I have code that does this for a normal java program.
    How do you go about using a custom class loader in an applet?
    Would something like this work? (using say *.Xclass local encrypted class files)
    ..somewhere in theapplet: init().. runClass()
    .public void runClass(name)
    { aCL = new AppletClassLoader(); // extends ClassLoader
    Class c = aCL.loadClass(name);
    Method m= c.getMethod("main"..)
    m.invoke(...);
    Your comments or pehaps a code snippet would be appreciated.
    Thanks, John

    John,
    this does not work without modifying the runtime client environment.
    Security constraints will prevent you from setting up a new class loader, so you will have to at least grant this permission in a policy file deployed to your clients as you will have to deplay the encryption keys.
    As bringing in a new class loader from an applet is highly security critical, this should be backed by a rather strict policy and by signing the applet.
    Though the example you provided might work, the class loader implementation itself is not so easy-
    If you would like to imitate the findClass() and loadClass() methods from SUN you will see that those are complex and not suitable for "hooking" in an encrypted stream.
    You might try an easier way:
    Load the class data as an encrypted byte array, decrypt it and use SUNs class loader methods to define a JAVA class out of this byte array:
    ClassLoader.defineClass(String�name, byte[]�b, int off, int�len)
    This seems to be easier than implmenting your own loader.
    Oliver

  • Pls answer my three questions: custom install : web cache applet support: Urgent

    we are using 9iAS v 10200 in win2000 server.
    Here are my queries:
    1: Does 9iAS v 10200 support custom installation ? For example I
    want to install only web server,webcache,forms & reports support.
    If custom installation of individual components is not available
    on v 10200 then in which version it is supported ?
    2. whenever I try installs 9iAS v 10200 from network,then after
    rebooting(during start of installation)it gives JRE error. is
    this a limitation of 9iAS v 10200 ?
    3. 9iAS v 10200 web cache does not support applet. In which
    version of 9iAS web cache would support applet ?
    Its urgent. Thanks in Advance
    yogesh

    Custom installation is not supported for iAS but we have four
    different install types & you can select according to yor need
    these are all available with iAS10221 onwards.You check for
    installation docs related to the version you are using.

  • How to load an applet using custom classloader ?

    Hi All,
    How to load an applet using custom classloader rather than using default browsers classloader i.e AppletClassLoader usually ?
    Regards,
    Kumar.

    I would guess that that would require two applets.
    The first does nothing but create the custom class loader and then load the second applet.

  • Developing Custom Applet in Oracle Webcenter

    Hi,
    We can create custom component in Oracle Webcenter Content Server.
    We can use different ways to create resource for these custom components, one of which is "HTML includes", which can contain Idoc Script and valid HTML code, including JavaScript, Java applets etc.
    Could anybody give an example of 'HTML includes' calling/including *'Java Applet'*?
    Any pointer for the same will be helpful.
    Thanks

    OOTB there is only one page I'm aware that contains links to applets: Administration - Applet Admin.
    Note that the reason for this page is that the same (admin) functionality is provided in an applet as well as in Java standalone mode (if no server runs). I'd discourage you from writing applets for an end-user functionality.

Maybe you are looking for

  • Problem creating documents using BAPI_DOCUMENT_CREATE2

    Dear all, I am using BAPI_DOCUMENT_CREATE2 to create a quality document attachment ( PDF file)  for one of our dynpro screen.. then  I retrive the document information using  'BAPI_DOCUMENT_CHECKOUTVIEW2 and show the document using function module CV

  • FRM-92100 java.lang.NullPointerException with menu

    Hi, I have the following error when I attach a menu (mmb) to a form and then execute. But If I execute the form without the menu mmb, it works fine: FRM-92100: votre connexion au serveur a été interrompue. Causes possibles: erreur réseau ou panne du

  • Problems viewing exported .mov file from Mac for viewing on PC

    I am working with a reporter who has a PC at home while I am editing a video for her using FCE 4.1 on a MacBook Pro, using HD footage from a Canon Vixia HF20 AVCHD camera. I burned a draft of the video we are working on for her to look at on her home

  • Difficulties transferring files between Lion and Leopard

    Hello all- The short: Our two computers running Leopard can transfer files across our home network to all other computers with no problems, and can grab files from other computers with no problems. Our new iMac Lion can't do any of that. The long: We

  • Dreamweaver CS3 crashing.

    Is anybody else getting problems where Dreamweaver CS3 keeps crashing particularly when trying to transfer files from/to a web server. I'm running it on Vista Ultimate using WebDAV as the transfer protocol, is that makes any difference. Cheers, @ndyB