How to load a MediaFile in an Applet?

Hi,
I am new at Java programming.
For a project I have to implement a media player and open a media-file via FileChooser. I managed to load files via HTML-Task "value". My question is: how can I use the FileChooser to do that?

Yes you can create a signed Applet to do this but what is the point? If you want to make an Applet to play media files then surely the media files to be played should reside on your server. If this is the case then there is no point in opening a file dialog to browse the client machine but rather your Applet should hold a list of files available to the user and present them with some means of choosing which one they want loaded - a JList or a JComboBox perhaps?

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

  • 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

  • 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 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 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 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

  • 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.

  • Loading an image into an Applet from a JAR file

    Hello everyone, hopefully a simple question for someone to help me with!
    Im trying to load some images into an applet, currently it uses the JApplet.getImage(url) method just before registering with a media tracker, which works but for the sake of efficiency I would prefer the images all to be contained in the jar file as oppossed to being loaded individually from the server.
    Say I have a class in a package eg, 'com.mydomain.myapplet.class.bin' and an images contained in the file structure 'com.mydomain.myapplet.images.img.gif' how do I load it (and waiting for it to be loaded before preceeding?
    I've seen lots of info of the web for this but much of it is very old (pre 2000) and im sure things have changed a little since then.
    Thanks for any help!

    I don't touch applets, so I can't help you there, but here's some Friday Fun: tracking image loading.
    import java.awt.*;
    import java.awt.image.*;
    import java.beans.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    import javax.imageio.event.*;
    import javax.imageio.stream.*;
    import javax.swing.*;
    public class ImageLoader extends SwingWorker<BufferedImage, Void> {
        private URL url;
        private JLabel target;
        private IIOReadProgressAdapter listener = new IIOReadProgressAdapter() {
            @Override public void imageProgress(ImageReader source, float percentageDone) {
                setProgress((int)percentageDone);
            @Override public void imageComplete(ImageReader source) {
                setProgress(100);
        public ImageLoader(URL url, JLabel target) {
            this.url = url;
            this.target = target;
        @Override protected BufferedImage doInBackground() throws IOException {
            ImageInputStream input = ImageIO.createImageInputStream(url.openStream());
            try {
                ImageReader reader = ImageIO.getImageReaders(input).next();
                reader.addIIOReadProgressListener(listener);
                reader.setInput(input);
                return reader.read(0);
            } finally {
                input.close();
        @Override protected void done() {
            try {
                target.setIcon(new ImageIcon(get()));
            } catch(Exception e) {
                JOptionPane.showMessageDialog(null, e, "Error", JOptionPane.ERROR_MESSAGE);
        //demo
        public static void main(String[] args) throws IOException {
            final URL url = new URL("http://blogs.sun.com/jag/resource/JagHeadshot.jpg");
            EventQueue.invokeLater(new Runnable(){
                public void run() {
                    launch(url);
        static void launch(URL url) {
            JLabel imageLabel = new JLabel();
            final JProgressBar progress = new JProgressBar();
            progress.setBorderPainted(true);
            progress.setStringPainted(true);
            JScrollPane scroller = new JScrollPane(imageLabel);
            scroller.setPreferredSize(new Dimension(800,600));
            JPanel content = new JPanel(new BorderLayout());
            content.add(scroller, BorderLayout.CENTER);
            content.add(progress, BorderLayout.SOUTH);
            JFrame f = new JFrame("ImageLoader");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setContentPane(content);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
            ImageLoader loader = new ImageLoader(url, imageLabel);
            loader.addPropertyChangeListener( new PropertyChangeListener() {
                 public  void propertyChange(PropertyChangeEvent evt) {
                     if ("progress".equals(evt.getPropertyName())) {
                         progress.setValue((Integer)evt.getNewValue());
                         System.out.println(evt.getNewValue());
                     } else if ("state".equals(evt.getPropertyName())) {
                         if (SwingWorker.StateValue.DONE == evt.getNewValue()) {
                             progress.setIndeterminate(true);
            loader.execute();
    abstract class IIOReadProgressAdapter implements IIOReadProgressListener {
        @Override public void imageComplete(ImageReader source) {}
        @Override public void imageProgress(ImageReader source, float percentageDone) {}
        @Override public void imageStarted(ImageReader source, int imageIndex) {}
        @Override public void readAborted(ImageReader source) {}
        @Override public void sequenceComplete(ImageReader source) {}
        @Override public void sequenceStarted(ImageReader source, int minIndex) {}
        @Override public void thumbnailComplete(ImageReader source) {}
        @Override public void thumbnailProgress(ImageReader source, float percentageDone) {}
        @Override public void thumbnailStarted(ImageReader source, int imageIndex, int thumbnailIndex) {}
    }

  • How to load java class from jsp page?

    hi all!
    Does anyone know how to load java class from jsp page?
    I try to load java class from jsp page.
    Is it possible to load java class fom jsp page?
    thanks and have a good day!

    What I mean is How to load/open java class file from jsp page?
    I think we can open Applet from jsp page by using
    <applet code=helloApplet.class width=100 height=100>
    </applet>
    but, how to open java class which is an application made by Frame?
    thanks and have a good day

  • How to load .cap on a smart card

    Hi everybody!
    I am very confused with java cards. I wrote an applet for java card. Tried it in Eclipse+JCWDE. Send some APDUs to it with apdutool.bat. Works fine!
    However, I want to go further and try it on a real smart card. The only problem is I do not know how to load .cap file onto my card. I tried to find some forums, references or something like that, but all I found was "I tried to load, but get error" or something like that.
    I use JCOP tool for Eclipse (if that to any help)
    Can someone explaine to me how loading works in princip? Is their any classes that can be used to simplify the task?
    Any help is appreciated
    /L

    Yes, of course. Absolutely normal .zip file.
    I can print the content of file load.jcsh here:
    # /set-var path d:/Wi-Fi/javacard/download/eappsk32k
    #Switch trace mode on and connect to a PC/SC smart card reader
    /mode trace=on
    /terminal
    #Reset the card (request ATR) and select the CardManager
    /card
    #Set the keys in key set 255 of the JCShell for authentication later on
    set-key 255/1/DES-ECB/404142434445464748494A4B4C4D4E4F
    set-key 255/2/DES-ECB/404142434445464748494A4B4C4D4E4F
    set-key 255/3/DES-ECB/404142434445464748494A4B4C4D4E4F
    #Begin authentication using the appropriate key set
    init-update 255
    #Complete authentication
    ext-auth
    #Display the card registry to check if the applet is loaded and installed
    card-info
    #delete 11223344556601
    #delete 112233445566
    card-info
    #Upload the package holding the applet
    upload ${path}openeapsmartcard.cap
    #Install the applet in the package
    install 112233445566 11223344556601
    #Display the card registry to check if the applet is loaded and installed
    card-info You should make some substitutes for your project.

  • How do I enable capability to run applets?

    I was trying to access and online course from a site I had success with a few weeks ago (February, 2014).  Today, March 3, 2014, I was unable to load the course from the course menu. 
    I used the site system requirements check and all was well except capability to run applets.
    I am running OSX version 10.6.8, Safari 5.1.10, Java SE 6 version 1.6.0_65-b14-462.
    How do I enable capability to run applets?
    I read related support community items but they did not help. 

    hello, lower the security level within the java settings in the system control panel: http://www.java.com/en/download/help/jcp_security.xml

  • How to load a Jar file in the class path?

    How to load a Jar file which contains class files, images, etc.. in the classpath without using URLClassLoader.

    You don't "load" jars. If it's on the classpath, you can obtain individual resources from it using various methods on either Class or ClassLoader. Do you mean "how to add a jar to the classpath at runtime"? Can't be done without using a classloader, typically URLClassLoader or a subclass thereof. Why you want to not use the proven method is beyond me. Presumably because you don't understand classloading. In which case, forget it.

  • How to load a client file in a clob using sqlcl

    How to load a client file in a clob using sqlcl

    You don't "load" jars. If it's on the classpath, you can obtain individual resources from it using various methods on either Class or ClassLoader. Do you mean "how to add a jar to the classpath at runtime"? Can't be done without using a classloader, typically URLClassLoader or a subclass thereof. Why you want to not use the proven method is beyond me. Presumably because you don't understand classloading. In which case, forget it.

  • How to load data to a cube from multiple infosources ?

    Hi friends,
    How to load data to a cube from multiple infosources ? could u please answer this question .
    thanks in advance......

    Hi ,
    say for example you need to load data to 1 cube from 3 info sources:
    1) You need to create 3 update rules for the Cube.
    2) Each time you create the update rules. Mention the name the name of the Info source. and create update rules correspondingly.
    Regards
    satish
    Message was edited by:
            satish murthy

Maybe you are looking for

  • What error is this? for BouncyCastle

    I tried to run this bouncycastle example but encounter this error? what happen to this?? can someone enlighten me? thanks. D:\testing>java PKCS12Example Exception in thread "main" java.io.IOException: exception encrypting data - java .security.NoSuch

  • IBooks Author HTML5 Widget won't open in full screen

    Hi, I am building a ebook using iBooks Author, the ebook includes HTML5 widgets on several of the pages. Upon testing the book on desktop the HTML5 widgets work as they should (opening in full screen). However, when I test this on the latest iPad air

  • File GPP preference item fails path not found

    Hi, I have a GPP preference item, for a file, to copy it from a file share to C:\ on my servers. The computer 'SetACL.exe' preference item in the 'Base Tools {0CC263CF-2996-40A5-8690-9C8E7A2314C5}' Group Policy Object did not apply because it failed

  • 6233 E-mail Set-up!

    Hi there Does anyone have the manual e-mail setup of a nokia 6233.

  • Thumbnails not appearing in iPhoto 6.

    Recently when opening iPhoto'06 I got the drop-down to rebuild my thumbnails which I accepted. It was proceeding quite slowly for a while and then a sudden rush to completion (over 500 photos in there). Next thing, I have less than half of the thumbn