Accessing Pictures from JApplet through JPanel

Hi there!
First of all, Thanks for giving time to read me!
I made a game, which is in JPanel. It accesses some images from the file (JPEGs and GIFs) from local disk.
Now, If I put that JPanel in an Applet (or JApplet), I am getting security errors of can't access files.
I have used URLs in ImageIcons (with "localhost", "file", "filename").
Why is that?
Is there any way of accessing Image files from a JAR package??
Please reply it soon, as i have to submit the game in the competition next week.
Thanks.

Hi there!
One more similar problem... :(
I want to put my Java game (created in JPanel) online through JApplet.
I have put the images & sounds for that online. (e.g. "http://bla.bla.com/images/image.gif").
Now if I run the program in JFrame, it is loading and working fine! But in Applet, I am getting security warnings/errors. Can anyone help please?
Here's the sample code:
public class Game extends JPanel {
URL url = null;
URLConnection con = null;
//Constructor{
try{
url = new URL("http://....../image.gif");
conn = url.openConnection();
}catch(Exception e){/Message}
ImageIcon img = new ImageIcon(url);
}

Similar Messages

  • How do I access pictures from my iPhone saved in iCloud so that I can delete some of them from iCloud selectively?.

    How do I access pictures from my iPhone saved in iCloud in a computer so that I can see & delete some of them from iCloud to free up the free 5GB?.

    What Mac model do you have? What system version and iPhoto version are you running?  Do you meet these requirements:
    The following is for this Apple document: iCloud: Photo Stream FAQ
    What do I need to use Photo Stream?
    To use Photo Stream, including Shared Photo Streams, you need an iCloud account, compatible devices, and up-to-date software:
    iPhone, iPad, or iPod touch with iOS 6.0 or later
    Mac with OS X Mountain Lion v10.8.2 or later and iPhoto 9.4 or Aperture 3.4 or later
    PC with Windows 8, Windows 7, or Windows Vista (Service Pack 2) and the iCloud Control Panel 2.1 or later for Windows
    Apple TV (2nd generation) with Software Update 5.1 or later
    You can still use Photo Stream without Shared Photo Streams if your devices meet these requirements:
    iPhone, iPad, or iPod touch with iOS 5.1 or later
    Mac with OS X Lion v10.7.5 or later and iPhoto 9.2.2 or Aperture 3.2.3 or later
    PC with Windows 7 or Windows Vista (Service Pack 2) and the iCloud Control Panel v2.0 or later for Windows
    Apple TV (2nd generation) with Software Update 5.0 or later
    If you do then sign in to the same iCloud account that's on your iPhone on your Mac via the System/iCloud Preference pane as shown in this screenshot:
    Next setup iPhoto's Photo Stream preference pane as shown in this screenshot:
    The photos on your iPhone must be in it's Photo Stream so make sure the iPhone has enabled Photo Stream as shown below:
    Now you can select a photo in the Photo Stream section of iPhoto and control-click on it to delete it:
    OT

  • Just upgraded from snow leopard to maverick.  Can't access pictures from iPhoto now.

    Suggestions?

    No suggestions until you explain what "can't access pictures from iPhoto now"... means, or even looks like.
    There are 9 different versions of iPhoto and they run on 9 different versions of the Operating System. The tricks and tips for dealing with issues vary depending on the version of iPhoto and the version of the OS. So to get help you need to give as much information as you can. Include things like:
    - What version of iPhoto.
    - What version of the Operating System.
    - Details. As full a description of the problem as you can. For example, if you have a problem with exporting, then explain by describing how you are trying to export, and so on.
    - History: Is this going on long? Has anything been installed or deleted? - Are there error messages?
    - What steps have you tried already to solve the issue.
    - Anything unusual about your set up? Or how you use iPhoto?
    Anything else you can think of that might help someone understand the problem you have.

  • HT4847 How do I access pictures from my iCloud from a previous phone?

    Does anyone know how to access photos from the iCloud?  My iCloud from my previous phone shows up on my new one but my old one was broken and I wasn't able to retrieve any information from it.

    To see those pictures you have to restore from previous icloud back up.
    instructions how to restore from icloud back up here.
    iOS: How to back up - Apple - Support

  • HT4859 i want to access pictures from a backup only! not restore a device, how do i do this?

    I need to get acess to a backup, as in WHAT it backed up in terms of pictures. I do not want or need to restore a device, just access picturs.

    It is not possible to examine specific data stored in an iCloud backup, except by restoring it to your device.  If backing up with iTunes, it's possible to use 3rd party software to extract data from a backup, but not with iCloud backups.

  • Inserting Picture (from Web- through Webdav) to Word document using VSTO code

    Hi,
    I have been trying to insert an image/picture to current selection in word. with help of code -
    Microsoft.Office.Interop.Word.InlineShape s = this.Application.Selection.InlineShapes.AddPicture(
    @"http://127.0.0.1:9001/test/myimage.png", true, true, Type.Missing);
    This code works fine if image is on desktop or network shared location but some issues for URL exposed through Webdav.
    On inserting the picture word shows - "The linked image cannot be displayed....." message. If we close and open word document again then image appears properly.
    Some observations:
    1. If we use same option through Ribbon  "Insert -> Picture -> Enter path and click on "Link to File" then we get Prompt for Wevdav password (Only once, later Word caches it) and linked images appear properly.
    2. Updating the shape explicitly wouldnt help. 
    s.LinkFormat.Update();
    What we are looking for is, Does Ribbon "Insert" functionality do something additional to prompt Webdav authentication to cache? if we want to achieve the same? what needs to be invoked before we make call to AddPicture API?
    Thanks
    H

    Thanks for the response.. 
    No, when document is opened again, then you dont need to enter the password. 
    Somehow on document open event MS word knows how to retreive password from cookie for given domain.
    When you insert the image using ribbon -> insert picture option, 
    MS Word first looks into cache if the domain cokkie already available then bypass authentication/password prompt
    Otherwise it would show the prompt and store the cookie in cache again.
    The mystry is how MS-Word interacts with this "cached cookies"
    while doing more reading on this, it seems MS Word has been using Klink.dll for this kind of functionality https://support.microsoft.com/en-us/kb/899927 but it would be great if you can provide more pointers.
    >>Could you share an image link of Webdav?
    Since, it's my local webdav server, you would not be able to access the image link, may be you can upload an image to sharepoint (as sharepoint also supports webdav) and use that for reproducing this problem at your end.
    Thanks
    H

  • Cannot access file from JApplet

    I have used the swingall.jar file with my JApplet for any
    version of IE. It gives one error
    i.e
    Cannot access file c:\prog\project
    I want to create a directory within c:\prog and also i want
    to write some files there. Pls help me.

    try this my friend!
    1.     Compile the applet
    2.     Create a JAR file
    3.     Generate Keys
    4.     Sign the JAR file
    5.     Export the Public Key Certificate
    6.     Import the Certificate as a Trusted Certificate
    7.     Create the policy file
    8.     Run the applet
    Susan
    Susan bundles the applet executable in a JAR file, signs the JAR file, and exports the public key certificate.
    1.     Compile the Applet
    In her working directory, Susan uses the javac command to compile the SignedAppletDemo.java class. The output from the javac command is the SignedAppletDemo.class.
    javac SignedAppletDemo.java
    2.     Make a JAR File
    Susan then makes the compiled SignedAppletDemo.class file into a JAR file. The -cvf option to the jar command creates a new archive (c), using verbose mode (v), and specifies the archive file name (f). The archive file name is SignedApplet.jar.
    jar cvf SignedApplet.jar SignedAppletDemo.class
    3.     Generate Keys
    Susan creates a keystore database named susanstore that has an entry for a newly generated public and private key pair with the public key in a certificate. A JAR file is signed with the private key of the creator of the JAR file and the signature is verified by the recipient of the JAR file with the public key in the pair. The certificate is a statement from the owner of the private key that the public key in the pair has a particular value so the person using the public key can be assured the public key is authentic. Public and private keys must already exist in the keystore database before jarsigner can be used to sign or verify the signature on a JAR file.
    In her working directory, Susan creates a keystore database and generates the keys:
    keytool -genkey -alias signFiles -keystore susanstore -keypass kpi135 -dname "cn=jones" -storepass ab987c
    This keytool -genkey command invocation generates a key pair that is identified by the alias signFiles. Subsequent keytool command invocations use this alias and the key password (-keypass kpi135) to access the private key in the generated pair.
    The generated key pair is stored in a keystore database called susanstore (-keystore susanstore) in the current directory, and accessed with the susanstore password (-storepass ab987c).
    The -dname "cn=jones" option specifies an X.500 Distinguished Name with a commonName (cn) value. X.500 Distinguished Names identify entities for X.509 certificates.
    You can view all keytool options and parameters by typing:
    keytool -help
    4.     Sign the JAR File
    JAR Signer is a command line tool for signing and verifying the signature on JAR files. In her working directory, Susan uses jarsigner to make a signed copy of the SignedApplet.jar file.
    jarsigner -keystore susanstore -storepass ab987c -keypass kpi135 -signedjar SSignedApplet.jar SignedApplet.jar signFiles
    The -storepass ab987c and -keystore susanstore options specify the keystore database and password where the private key for signing the JAR file is stored. The -keypass kpi135 option is the password to the private key, SSignedApplet.jar is the name of the signed JAR file, and signFiles is the alias to the private key. jarsigner extracts the certificate from the keystore whose entry is signFiles and attaches it to the generated signature of the signed JAR file.
    5.     Export the Public Key Certificate
    The public key certificate is sent with the JAR file to the whoever is going to use the applet. That person uses the certificate to authenticate the signature on the JAR file. To send a certificate, you have to first export it.
    The -storepass ab987c and -keystore susanstore options specify the keystore database and password where the private key for signing the JAR file is stored. The -keypass kpi135 option is the password to the private key, SSignedApplet.jar is the name of the signed JAR file, and signFiles is the alias to the private key. jarsigner extracts the certificate from the keystore whose entry is signFiles and attaches it to the generated signature of the signed JAR file.
    5: Export the Public Key Certificate
    The public key certificate is sent with the JAR file to the whoever is going to use the applet. That person uses the certificate to authenticate the signature on the JAR file. To send a certificate, you have to first export it.
    In her working directory, Susan uses keytool to copy the certificate from susanstore to a file named SusanJones.cer as follows:
    keytool -export -keystore susanstore -storepass ab987c -alias signFiles -file SusanJones.cer
    Ray
    Ray receives the JAR file from Susan, imports the certificate, creates a policy file granting the applet access, and runs the applet.
    6.     Import Certificate as a Trusted Certificate
    Ray has received SSignedApplet.jar and SusanJones.cer from Susan. He puts them in his home directory. Ray must now create a keystore database (raystore) and import the certificate into it. Ray uses keytool in his home directory /home/ray to import the certificate:
    keytool -import -alias susan -file SusanJones.cer -keystore raystore -storepass abcdefgh
    7.     Create the Policy File
    The policy file grants the SSignedApplet.jar file signed by the alias susan permission to create newfile (and no other file) in the user's home directory.
    Ray creates the policy file in his home directory using either policytool or an ASCII editor.
    keystore "/home/ray/raystore";
    // A sample policy file that lets a JavaTM program
    // create newfile in user's home directory
    // Satya N Dodda
    grant SignedBy "susan"
         permission java.security.AllPermission;
    8.     Run the Applet in Applet Viewer
    Applet Viewer connects to the HTML documents and resources specified in the call to appletviewer, and displays the applet in its own window. To run the example, Ray copies the signed JAR file and HTML file to /home/aURL/public_html and invokes Applet viewer from his home directory as follows:
    Html code :
    </body>
    </html>
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    width="600" height="400" align="middle"
    codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,1,2">
    <PARAM NAME="code" VALUE="SignedAppletDemo.class">
    <PARAM NAME="archive" VALUE="SSignedApplet.jar">
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
    </OBJECT>
    </body>
    </html>
    appletviewer -J-Djava.security.policy=Write.jp
    http://aURL.com/SignedApplet.html
    Note: Type everything on one line and put a space after Write.jp
    The -J-Djava.security.policy=Write.jp option tells Applet Viewer to run the applet referenced in the SignedApplet.html file with the Write.jp policy file.
    Note: The Policy file can be stored on a server and specified in the appletviewer invocation as a URL.
    9.     Run the Applet in Browser
    Download JRE 1.3 from Javasoft
    save this to write.jp
    keystore "/home/ray/raystore";
    // A sample policy file that lets a JavaTM program
    // create newfile in user's home directory
    // Satya N Dodda
    grant {
    permission java.security.AllPermission;
    save this to signedAppletDemo.java
    * File: @(#)SignedAppletDemo.java     1.1
    * Comment:     Signed Applet Demo
    * @(#)author: Satya Dodda
    * @(#)version: 1.1
    * @(#)date: 98/10/01
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.io.*;
    import java.awt.Color;
    * A simple Signed Applet Demo
    public class SignedAppletDemo extends Applet {
    public String test() {
    setBackground(Color.white);
         System.out.println(System.getProperty("user.home"));
         String fileName = System.getProperty("user.home") +
                        System.getProperty("file.separator") +
                        "newfile";
         String msg = "This message was written by a signed applet!!!\n";
         String s ;
         try {
         FileWriter fos = new FileWriter(fileName);
         fos.write(msg, 0, msg.length());
         fos.close();
         s = new String("Successfully created file :" + fileName);
         } catch (Exception e) {
         System.out.println("Exception e = " + e);
         e.printStackTrace();
         s = new String("Unable to create file : " + fileName);
         return s;
    public void paint(Graphics g) {
    g.setColor(Color.blue);
    g.drawString("Signed Applet Demo", 120, 50);
    g.setColor(Color.magenta);
    g.drawString(test(), 50, 100);

  • When trying to access pictures from web site upload (Blogger),access denied

    It's my first week using a Mac, so I'm a beginner. For some reason I can't access the pictures that I have loaded in iPhoto from websites (for uploading). Pictures that are not inside iPhoto load fine.
    I tried looking at my permissions settings, etc, but can't see any reason why it won't let me. I've seen two iterations of this. One type is that it greys out the iPhoto file so I can't click on it, and the other time it allows me to click on it but doesn't expland it (there is no triangle beside it indicating additional files inside).
    Accessing iPhoto directly allows me to get at every picture I have, and edit at will.
    Help would be greatly appreciated!

    Scubabear
    Welcome to the Apple Discussions.
    What version of iPhoto are you using? This sounds like an iPhoto v7 issue. (iPhoto Menu -> About iPhoto)
    There are three ways (at least) to get files from the iPhoto Window.
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    To upload to MySpace or any site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. If you're using Gmail you can use THIS
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser. Or, if you want to access the files with iPhoto not running, then create a Media Browser using Automator (takes about 10 seconds) or use THIS
    Also, for 10.5 users: If you use the extended Open or Attach dialogue (with Column View) you can scroll to the bottom of the Shortcuts and find the Media browser there. Select any pic you want from there.
    Regards
    TD

  • Accessing pictures from Verizon Droid Charge

    My phone was stolen a few weeks ago. All of my children's recent pictures are on that phone and that is the only reason I have not yet cut the phone off. The person who has stolen the phone cannot get passed my password so they cannot run my bill, however they still have it and I would like to just get my pictures somehow and finally disconnect it.
    Does anyone know how I can possibly access my memory card somehow ?? please help. I'm devestated that all of my babies pictures and videos are just gone.

    KhaiLi2011 wrote:
    My phone was stolen a few weeks ago. All of my children's recent pictures are on that phone and that is the only reason I have not yet cut the phone off. The person who has stolen the phone cannot get passed my password so they cannot run my bill, however they still have it and I would like to just get my pictures somehow and finally disconnect it.
    Does anyone know how I can possibly access my memory card somehow ?? please help. I'm devestated that all of my babies pictures and videos are just gone.
    Unless you installed special software before you lost the phone, there is no way to remotely recover information from your phone.  Did you upload any of the photos to Picasa or a similar service?  You may want to check your Google accounts (Gmail, Picasa) to see if anything was automatically uploaded or sent and now stored on their servers.
    Other than that, the pictures are gone, which is unfortunate, but it is the reality.  You should file a report with the police  and call Verizon to report the phone stolen (which will get the ESN placed on a blacklist).  That way, the thief cannot use the phone (you can get past passwords if you are skilled and determined), and they cannot sell it to someone who may buy it in good faith thinking it is theirs to sell.

  • 1st post ever!  I can't access pictures from documents

    I don't think I'm even on the proper forum, so you can see this is not easy for me.
    Here's the deal-
    when I go into documents, I cannot access some pictures I have in there. The error message says, {unable to unarchive "pics from the 2nd platoon.zip" into desktop Error 1 Operation not permitted}
    I'd like to be able to email these pictures.
    This is probably way too simple for you folks, but I could sure use some help.
    thanks, Peter

    Peter,
    This forum area is about servers and OSX server software... Possibly the people here are not familiar with your issue. I am not familiar with your issue.
    It looks like you may be addressing an issue in OSX client? If you are looking for assistance in OSX client you may want to try here:
    http://discussions.apple.com/category.jspa?categoryID=235 if you have 10.5
    or here:
    http://discussions.apple.com/category.jspa?categoryID=160 if you have 10.4
    Hope this helps.

  • HT4236 Accessing pictures from Mac on iPhone

    I recently downloaded my photos from my iphone to my mac computer and it deleted the pictures off of my iphone.  I am now away from my mac computer and need a couple of the pictures for work.  Is there a way to access the pictures on my mac from my iphone

    Not without a third party app such as Team Viewer - but you would have had to install that before you were away from the Mac. Do you have PhotoStream turned on?

  • Access data from SqlServer through Visual Composer.....?

    Hi Gurus,
    I could able to connect SqlServer database from Visual Composer. After that, how can I access table data from sqlserver database?
    Thanks in advance....
    Ravindra.

    Ravindra,
    Here is the work around to do this. You will need to create a New System.  In the Portal go to System Administration -> System Configuration -> System Landscape.  Create a New System from PAR.  Select com.sap.portal.systems.BIUDI, click Next.  Select SAP_BI_JDBC and enter all the information that you would normally use to connect to a SQL DB using JDBC.  You can then in the VC run SQL against the tables.  Open VC, and Navigate to the iView level and go to the toolbar and Select BI -> SQL Editor.  It is pretty self-explanatory from there.
    Regards,
    Peter

  • Problem accessing database from JApplet

    Hi all,
    I am having trouble in changing my application to Japplet. It displaying the frame in web page but when i am trying to access database it is not displaying anything. Please let me know if any one know the solution. Thank you.
    bestpro.

    It is hard to say since you didn't post any exceptions you are getting but I would venture to guess you are getting a security exception and you need to sign your applet so your applet can play outside of the security sandbox and connect to your db server.
    Hit google and search for "signing applets" or something similiar and it should put you on the right path.

  • Why can't  I download pictures from camera through a usb hub

    Hi Folks,
    I am trying to download pictures to Lightroom 4 in MacBook Pro and it will work fine if the download is directly from the camera to the MacBook via a USB cable from camera to computer.  However, when I use a USB hub from the camera to hub via USB cable (and then hub to computer), the computer (and Lightroom) does not appear to recognize that there is a source for picture downloads.  Anyone experience similar issues and any solutions (other than continue to use a USB cable between camera and computer directly)?  Thanks much in advance for any thoughts.
    Dave
    Fort Collins, CO

    Yes, it is self powered.  Belkin F5U307.  Searching beforehand revealed there is compatability between this hub and MBP.  Also, it is a 7 port hub, I have two other hubs (not active simultaneously when downloading pics), that are used to connect to iPhone and iPad, and they work fine for all purposes.  I have also tried all of the other hub ports that are not tied up, and they also do not work when it comes to downloading pics from the camera (Canon 5D Mark 2).
    Thanks for your help,
    Dave

  • I have take pictures from my ipad 4. How to download to my computer with windows operating system conneted through USB cable with out using internet

    I have take pictures from my ipad 4. How to download to my computer with windows operating system conneted through USB cable with out using internet

    Plug your iPad into your computer. THere may be a delay while it installs drivers but if you can see your iPad in windows explorer, use that to get to your photos.
    Click on your iPad and you should see a DCIM folder. Click thorugh that to find your photos.
    Windows explorer will see your iPad as nothing more than a digital camera, and that's the part you're trying to access.

Maybe you are looking for

  • How do I connect both a Mac and PC to Apple TV Home Sharing?

    Goal - I am trying to share both my PC and Mac through my Apple TV2 on the "Computers" home sharing menu. - These are 2 seperate iTunes accounts as they are 2 different owners of the PC and Macbook. - However, home sharing only allows me to have one

  • Is Flash animation possible in iWeb?

    I've tried dragging .swf files I made in Keynote into iWeb, but they just show up in a movie player and not a self playing animation. It wouldn't even show the transitions I made. Has anyone figured out if it's even possible to add Flash? Maybe in Ma

  • Classic Apps in Intel mac

    is there a way to run/convert classic applications to run on an Intel mac legally? or an easy way to convert freeware PPC apps into universal binaries? (preferably the latter). iMac intel core duo   Mac OS X (10.4.8)  

  • Specific billing type for material type HAWA

    Hi All, My client requirement is following. To have all HAWA material invoices be automatically set to new billing type ZHAW. We are using 4 types of sales order types and also 4 types of delivery document types. i think i can achieve this by user ex

  • Exception Alert in WAD

    is there a way to schedule alerts in WAD for exceptions. Like the manager wants to see a email in the morning every day for any exceptions that occur . Thanks