How to load a frame in applet...

i tried this code but ,i cannot see anything on the screen....
     Panel p=new Panel();
     Frame cf=new CheckFrame();
     p.add(cf);
     add(p);
     cf.show();
     cf.setVisible(true);
     cf.setSize(300,300);

     Panel p=new Panel();
     Frame cf=new CheckFrame();
     p.add(cf);You're sure you want to add the frame to the panel and not the panel to the frame? I think you've messed something up there.
I use frames opened up from an applet myself and usually get them to work by doing..
JFrame f = new JFrame();
//add the components
f.pack();
f.show();..as you would do it when writing a standalone application.
HTH,
kelysar

Similar Messages

  • How to load a java card applet into a java card

    Dear All,
    I am a novice to java card technology..
    I have done some search on how to load a java card applet into a smart card but haven't found a satisfactory answer. I have read about installer.jar and scriptgen tool but I want to load the applet from a java program and not from command line. It would be of great help if somebody can help me out.
    If somebody can share a sample program which load a javacard applet(.CAP file) into a smart card, I will be very thankful.
    I am able to find some client applications which help us send APDU commands and recieve response APDU's to interact with an applet loaded on to the smart card but not application which actually load the applet.
    I have heard of OCF and GP.. some say that OCF technology is outdated and no longer in use.. can somebosy throw some light on this too..
    cheers,
    ganesh

    hi siavash,
    thanks for the quick response.. i checked out GPShell as suggested, it looked like a tool by which one can load an applet on to card and send some sample apdu commands... but I want to load the applet from the code.
    My application should look something like this.. it will be a swing applicaton where I have a drop down with a list of readers, I select the one desired and then click on "LOAD" after inserting a blank java card, at this point my applet which is stored in my DB should get loaded on to the java card. The next step should be to personalize it where I enter the values for the static variables of my applet and click "PERSONALIZE", at this point all these values should be embedded into APDU commands and sent to the java card for processing.
    For achieving this I am yet to find a comprehensive sample or documentation on the net.
    Please help...
    regards,
    ganesh

  • How draw image into frame in applet

    How draw image into frame in applet.Please give my simple example code.

    http://search.java.sun.com/search/java/index.jsp?qt=%2Bdraw+%2Bimage+%2Bpanel+%2Bhow&nh=10&qp=&rf=1&since=&country=&language=&charset=&variant=&col=javaforums

  • How to call java frame in applet?

    i have a frame which i want to show in web browser i dont want to convert frame into applet if there is any pls tell

    Weren't you just told that a frame is a top level
    component?!Probably hoping for a magic solution. If I ask for the easiest path through the Himalaya often enough, the mountains might vanish...

  • Info on how to load jdk 1.1 applet

    I am totally new to this technology.
    How do I load a jdk 1.1 applet onto a geocities website?
    Do I need a special program to run the applet?
    I have uploaded the applet and cannot figure out how to operate it, I can find no html or class files.
    this is an applet for creating islamic tiling and interlacing, here is the url, if you are willing to come this far with me
    http://www.cs.washington.edu/homes/csk/tile/islam/
    Sorry, But I'm an artist and not a web site designer.
    Please explain in very simple terms
    Thank you
    Storm

    Use the HTML applet tags, if you know HTML. If all you want to do is the applet and nothing else, then just create the following HTML file in simpletext (save it as FileName.html), or even geocities file manager:
    html
    <applet code = "ClassName.class" width = 400 height 400>
    </applet>
    /html
    The numbers and file name listed above are just ones I used as an example. Use whatever ones you need to make it big enough and to load the class you want. And remember to put the < and > in the HTML tags, I didn't so that it would show up on this forum.
    This procedure WILL NOT work with Yahoo! PageBuilder, in case that's what you are using.
    Remember to upload the CLASS file into your geocities file manager/directory or it will not work.
    If all you want to do is load an applet and it doesn't work, then their is something wrong with your browser (probably because it doesn't support JAVA).
    Another good idea would be to download jdk 1.2.2 or jdk 1.3, probably found at sun.com somewhere (I'm still trying to find it, hehe!)
    Tell me if it works or not and whether or not you understand what I'm talking about. Thanx.
    -Conrad

  • Help! How to Open a Frame from applet with

    Hey all. I need help =).
    I want:
    1. Have 1 class extends applet with running thread (this far no prob)
    2. Open a new frame from the applet (no prob)
    3. Start a new thread which is operating "inside" the new Frame/class
    4. Draw a simple Rect in the new Frame with the new thread to test that the graphics work.
    Plz help,
    ~Trobsky

    �rr..... i cant draw on the Frame =(.
    Heres the code:

    public class Fonster extends java.applet.Applet {
         Frame myFrame;
         Fri friFonster=new Fri();
         public void init() {
              myFrame=new Frame();
              myFrame.resize(300,300);
              myFrame.show();
              myFrame.add(friFonster);
              friFonster.init();
              friFonster.start();
         public void paint(Graphics g)
              g.drawRect(10,10,100,100);
    public class Fri extends java.applet.Applet {
         public void init(){
              repaint();
         public void paint(Graphics g)
              g.drawRect(10,10,200,200);

  • How to load an applet in a swing frame?

    Hi All,
    Can any one tell how to load a HTML applet in a Swing frame, I have a requirement where in the swing frame must contain a HTML applet.
    Thanks in advance...
    Panneer.

    Panneerselvam wrote:
    Can any one tell how to load a HTML applet in a Swing frame, I have a requirement where in the swing frame must contain a HTML applet.You don't. The requirement reeks of the ridiculous.
    Also, what is an "HTML" applet and how is it different from a regular applet or JApplet? I feel a case of jargonitis coming on.

  • How to load and unload more than one external swf files in different frames?

    I do not have much experience on Adobe Flash or Action Script 3, but I know the basics.
    I am Arabic language teacher, and I design an application to teach Arabic, I just would like to learn how to load and unload more than one external swf files in different frames.
    Thanks

    Look into using the Loader class to load the swf files.  If you want to have it happen in different frames then you can put the code into the different frames.

  • How can I make media in swc load on frame 4?

    I created a project that is rather large... it has 20 or sound sound files, 10 or so fonts, and close to 400 png and jpeg files.
    Now,  all these assets were loaded in the fla library and over time, compile  started getting worse and worse to the point it was almost impossible to  debug without a 5 to 10 minute wait per build.
    After  many many hours and research I learend how to embed my media into an  swc. That, and turning off "warning mode" the compile time is now like,  10 secs down from 10 minutes - awesome.
    However, now my  preloader is not running because it has to wait for almost the full app  to download and run before it starts playing.
    I would  like to know how to delay the loading of the swc media so that the  projector will actually start playing before it's fully downloaded.
    Here is what I did.
    1.  Create a new fla, and put a bunch of graphics and media into the  library. Each media element has "export for action script" checked,  "Export on frame 1", a unquie class name and a base class defined.
    for example, let's say I have a png called "MyImage.png" in my library, and I give it a class name of classMyImage.
    2. Save the fla as "MyProject_library"
    3. In the publish settings, checked export swc. and publish it.
    now I have an swc in my project folder.
    4. Open my project, called "MyProject.fla" and open the action script settings.
    5. Set "Export classes in frame" to 4.
    6. Uncheck "Warnings Mode"
    7. In the "Library tab" I click the "browse to swc" button and select "MyProject_library.swc"
    8. Go to frame 1 of my project and create a blank frame.
    9. Go to frame 2 of my project, add a key frame and create my preloader code.
    addEventListener(Event.ENTER_FRAME, Preloader_Progress);
    stop();
    function Preloader_Progress(e:Event):void {
        var Loaded:int = this.root.loaderInfo.bytesLoaded;
         var Total:int = this.root.loaderInfo.bytesTotal;
         var p:Number = Loaded / Total;
        var perc:Number = Math.ceil(p * 100);
        txtPre.text = perc.toString() + "%";  // this is a text field on the stage on frame 2.
        if (Loaded >= Total) {
              gotoAndPlay(4);
    8. Go to frame 4 of my project, and for EVERY media element in my library, I add them to a dictionary so they get instantisated.
    import flash.utils.Dictionary;
    var swc = new Dictionary();
    swc["classMyImage"] = new classMyImage();
    I found that I HAVE to do this or assets will not load properly when I run the project.
    9. Build the rest of the project so I can get paid.
    10. Publish the swf and upload it to my website.
    Now, I don't get any errors, and after MUCH trial and error I  have finally got things working, however, before I migrated all my media  to the swc, the text field (with other graphics and progress bars and  pretty things) would become visible at about 5% and then fill up and  when at 100% would proceed to frame 4 and load all my media assets and  continue happily.
    After the migrating to the swc, I  look at a blank background for a while and then the app appears with the  text at 99%, this tells me that all my media is loading on frame 1,  thus not allowing the app to start playing until it's downloaded.
    I have tried exporting my swc with the "Export classes in frame" set to frame 4, but it made no difference.
    Anyone have any thoughts?

    I'm not sure it is possible since the time definition lies in the server/database and not reflect the time zone of the user.
    Any way I think it's the correct way to do since if users cross world would like to exchange data among them they will have same referenced time.

  • How to load an Applet application for 1000cards?

    Hi Friends..
    I want to know How to load an Applet application for 1000cards?..
    Assume that, i have an Applet application that need to loaded into 1000cards..
    So, how to solve this?
    Do i must to load an application manually for each card?
    Is there any another way?
    Thanks in advance..

    for 1000 cards you can use a "small" printer like an evolis "dualis" or something like that
    we've produced thousands of cards with this method in my company.
    the pro is that you can also print the cards in the same time.
    they usually have simple APIS like get_new_card_from_loader(), put_card_on_contacts(), eject_card()
    you can connect any reader on the printer , the raw card contacts are available on a connector.
    some printers also have contactless couplers.
    but remember that deploying cards in the field is not just loading an applet.
    it's also a cryptographic challenge, you need to change the card keys or anyone will be able to play with your cards, adding and removing applets as they want.
    typically this is achieved by using an ultra secret mother key and whatever derivation algorithm you like using data from INIT UPDATE as diversifier. example, you can TDES cipher part of the INIT UPDATE data using the mother key as TDES key, or use something involving SHA1, using a HSM if you are serious, etc.
    for your entertainment here is a high volume card personnalization machine. That's amazing.
    http://www.youtube.com/watch?v=6ZBF_yKRF5w

  • How to create a frame in a applet?

    Dear All,
    How to create a frame in a applet?
    Thanks in advance
    Kityy

    You can't add a Frame/JFrame to an Applet/JApplet.
    An Applet/JApplet has its origins in the class Panel/JPanel.
    So, if you make your Applet to an application you
    can easily do that by putting your Applet "above" a Frame.
    Maybe you can archieve your goals with some Panels?!

  • How to "Load" Applet class to current Applet?

    I have to write a simple Applet to detect the JVM version of the browser, and the flow is:
    1.Detector.class (Applet) load in a html page, its class version is 1.5
    2.It checks whether the JVM version of the browser is 1.5 / 1.6.
    3.If it is 1.5, a new browser window popup and links to jre download page.
    4.If it is 1.6, it loads a Main.class (Applet), which class version is 1.6
    My question is, if the codes inside the Detector.class detects the JVM version is 1.6, HOW can I LOAD the Main.class (Applet) to the current scene?
    Thanks for any suggestion and help.

    roamer wrote:
    ..My question is, if the codes inside the Detector.class detects the JVM version is 1.6, HOW can I LOAD the Main.class (Applet) to the current scene?
    Thanks for any suggestion and help.I suggest you change the flow.
    1. Go to the applet page with both the Main.class *&* the version check applet.
    2. If <1.6 is detected, have the version check applet redirect to the the 'download Java' page.
    Alternately:
    1. Go to the version check page.
    2. If 1.6+ is detected, redirect to the Main.class page, else redirect to 'download Java' page.
    I developed the [Version Check|http://pscode.org/jre.html] applet that can handle either of those alternatives.
    Another approach is to use the deployJava.js that checks Java versions before launching the applet.
    I also offer Wrapplet to do both the version checking and load 'child' applets. But note:
    1) With the other better alternatives, I have not looked closely at the code in a long while.
    2) Loading one applet in another is possible, but not easy.
    3) I half expect that each new Java micro-version will ruin it.

  • How to load an applet in card?

    Hi everyone,
    I use NetBeans and its JavaCard Simulator, protocol T = 0, and I am wandering how to load an applet using APDU tool instead of clicking on Run Projetc which do the mentioned thing. It would be helpfull if someone post ouptut and explain all used apdu commands.
    Thanks,
    Mare.

    Here is the APDU trace:
    Select Card Manager
    => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00
    <= 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65
        01 FF 90 00
    Authenticate
    cm>  init-update 255
    => 80 50 00 00 08 09 41 55 62 DF F5 61 2B 00
    <= 00 00 C6 D8 6A 1C B2 02 14 13 FF 02 00 00 93 73
        3A B8 2C 0F 8E A4 1D EF 84 60 77 12 90 00
    cm>  ext-auth plain
    => 84 82 00 00 10 B5 AA A8 E6 8B 73 57 F9 5D 37 6C
        D1 FE CF 56 32
    <= 90 00
    Install For Load
    => 80 E6 02 00 12 05 11 11 11 11 11 08 A0 00 00 00
        03 00 00 00 00 00 00 00
    <= 00 90 00
    Load Block 1
    => 80 E8 00 00 FF C4 82 01 65 01 00 1A DE CA FF ED
        02 02 04 00 01 05 11 11 11 11 11 0A 68 65 6C 6C
        6F 57 6F 72 6C 64 02 00 21 00 1A 00 21 00 0A 00
        0B 00 2A 00 0E 00 A1 00 0A 00 17 00 00 00 5A 02
        5A 00 00 00 00 00 00 01 01 00 04 00 0B 01 02 01
        07 A0 00 00 00 62 01 01 03 00 0A 01 06 11 11 11
        11 11 11 00 08 06 00 0E 00 00 00 80 03 00 FF 00
        07 01 00 00 00 1C 07 00 A1 00 01 10 18 8C 00 04
        7A 05 30 8F 00 09 3D 8C 00 02 18 1D 04 41 18 1D
        25 8B 00 03 7A 04 22 18 8B 00 07 60 03 7A 19 8B
        00 06 2D 1A 04 25 75 00 6D 00 06 00 00 00 1D 00
        01 00 2C 00 02 00 3B 00 40 00 4A 00 41 00 57 00
        42 00 62 19 8B 00 05 3B 19 03 1A 07 25 8B 00 08
        70 49 19 8B 00 05 3B 19 03 1A 07 25 8B 00 08 70
        3A 19 8B 00 05 3B 19 03 1A 07 25 8B 00 08 70 2B
        03 32 04 8D 00 00 32 1F 8D 00 01 70 1E 05 8D 00
        00 32 1F 8D 00
    <= 00 90 00
    Load other Blocks with  80 E8 00 xx ... which xx is the Block number
    Load Last Block
    => 80 E8 80 01 6A 00 01 70 13 03 8D 00 00 32 1F 8D
        00 01 70 08 11 6D 00 8D 00 01 7A 08 00 0A 00 00
        00 00 00 00 00 00 00 00 05 00 2A 00 0A 06 80 08
        10 06 80 07 01 06 00 00 01 03 80 03 02 06 80 03
        00 03 80 0A 06 03 80 0A 01 03 80 03 03 03 80 0A
        08 01 00 02 00 09 00 17 00 00 00 13 05 06 04 0A
        07 07 25 09 06 09 06 09 08 05 06 05 06 05 08 00
    <= 00 90 00
    Install For Install
    cm>  install -i 111111111111  -q C9#() 1111111111 111111111111
    => 80 E6 0C 00 1A 05 11 11 11 11 11 06 11 11 11 11
        11 11 06 11 11 11 11 11 11 01 00 02 C9 00 00 00
    <= 90 00Note that if you want to use APDU manually, you should do the authenticate process and loading all blocks of the CAP file yourself.
    Note that this is the APDU for a real card that is executed in JCOP Environment. I think it should work for the simulators too except the authentication commands.

  • How to load java applet to java-enabled card

    I have downlaoded the sdk n run some samples. but when i connect the card as through pcsc reader, and tried to install some ready applet in the card explorer,it fail n give me 6a80.
    How can i load a java card applet into a java-card?

    You will need a loader. To develop a loader, you will need to follow the steps outlined in the Global Platform specs to establish a secure channel and install.

  • How to load Java applets on Gemxplore 3G card ? (APDU inside)

    Hi,
    Does anyone have experience on how to load Java applets into Gemxplore 3G card ?
    I tried to load the tck applets into Gemxplore 3G card but the got sw 6985 for INSTALL FOR INSTALL Make Selectable
    Here is the details on APDUs.
    Do you know what is wrong ?
    Regards
    -guoqing
    SELECT
    *00 A4 04 00 07 A0 00 00 00 18 43 4D*
    *61 1A [Normal ending of the command with <26> bytes of extra information.]*
    INITIALIZE UPDATE
    *80 50 01 01 08 00 01 02 03 04 05 06 07 (1C)*
    *43 4D 6D FF 23 B5 C4 13 20 1A 01 01 9F 15 97 A5 CE E9 CF A7 19 C6 8D F9 8B 9A 78 DB, 90 00 [Normal ending of the command.]*
    EXTERNAL AUTHENTICATE
    *84 82 01 00 10 EB 88 23 3C B6 4E 23 E9 69 1B 30 08 56 7A 1F 8F*
    *90 00 [Normal ending of the command.]*
    INSTALL FOR LOAD
    *84 E6 02 00 24 09 A0 00 00 00 62 B0 BA A1 01 00 00 0E EF 0C C6 02 00 00 C8 02 00 00 C7 02 00 00 00 53 9D 96 C2 D4 8F 41 6B (00)*
    *00, 90 00 [Normal ending of the command.]*
    SELECT
    *00 A4 04 00 07 A0 00 00 00 18 43 4D*
    *61 1A [Normal ending of the command with <26> bytes of extra information.]*
    INITIALIZE UPDATE
    *80 50 01 01 08 00 01 02 03 04 05 06 07 (1C)*
    *43 4D 6D FF 23 B5 C4 13 20 1A 01 01 A5 57 A0 A0 00 7E 5A 3F A5 10 6A 37 69 16 AA 6F, 90 00 [Normal ending of the command.]*
    EXTERNAL AUTHENTICATE
    *84 82 01 00 10 28 BA 3A C4 D6 05 C9 C9 70 37 39 F1 7B 6D F8 80*
    *90 00 [Normal ending of the command.]*
    INSTALL FOR INSTALL Make Selectable
    *84 E6 0C 00 36 09 A0 00 00 00 62 B0 BA A1 01 09 A0 00 00 00 62 B0 BA A1 81 09 A0 00 00 00 62 B0 BA A1 81 01 00 0C EF 08 C7 02 00 00 C8 02 00 00 C9 00 00 A4 CE 57 8B 19 F2 9E 0A (00)*
    *69 85*
    Edited by: guoqing on May 19, 2008 6:06 AM
    Edited by: guoqing on May 19, 2008 6:20 AM

    I don't have any experience with GTO's cards, but one would expect they provide a user guide or a data sheet how to load applications.. Reasons could be:
    1. Issuer policy to have a certain security level for content management --> raise the security level to C_MAC + ENC
    2. Issuer policy this card is static --> no post-issuance

Maybe you are looking for