Errors with reading images

i am creating a paint program with which users will be able to import their own images. this is my first applet so i do not know how to fix these runtime errors i am receiving. they are:
java.security.AccessControlException: access denied (java.io.FilePermission /private/Network/Servers/mhsfile/Volumes/IQ/IQ_2006/(censored)/Documents/Adv Java/ read)
     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
     at java.security.AccessController.checkPermission(AccessController.java:401)
     at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
     at java.lang.SecurityManager.checkRead(SecurityManager.java:863)
     at sun.awt.image.URLImageSource.<init>(URLImageSource.java:37)
     at sun.applet.AppletImageRef.reconstitute(AppletImageRef.java:33)
     at sun.misc.Ref.get(Ref.java:46)
     at sun.applet.AppletViewer.getCachedImage(AppletViewer.java:377)
     at sun.applet.AppletViewer.getImage(AppletViewer.java:372)
     at java.applet.Applet.getImage(Applet.java:226)
     at Draw.init(Draw.java:18)
     at sun.applet.AppletPanel.run(AppletPanel.java:353)
     at java.lang.Thread.run(Thread.java:552)

here is the code :
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Draw extends JApplet implements ActionListener
     JLabel insert = new JLabel("please insert a picture");
     JTextField filename = new JTextField ("");
     JButton Enter = new JButton("enter");
     Button erase = new Button("erase");
     DrawPanel canvas;
     public void init()
          Container con = this.getContentPane();
          filename.getText();
          con.add(filename);
          erase.addActionListener(this);
          canvas = new DrawPanel(getImage(getCodeBase()));
          BorderLayout bord = new BorderLayout();
          setLayout(bord);
          add(canvas,"Center");
          Panel commandPanel = new Panel();
          commandPanel.add(erase);
          add(commandPanel, "South");
     public void actionPerformed(ActionEvent evt)
          if(evt.getSource().equals(erase))
               canvas.numPoints = -1;
               canvas.repaint();
class DrawPanel extends Panel
     Image picture;
     int[] drawX = new int[1000];
     int[] drawY = new int[1000];
     int numPoints = -1;
     DrawPanel(Image inputImage)
     picture = inputImage;
     public void paint(Graphics screen)
     screen.drawImage(picture,0,0,this);
     screen.setColor(Color.black);
     for(int i = 0;i<= numPoints;i++)
               screen.fillOval(drawX[i]-3, drawY[i]-3,6,6);
     public void update(Graphics screen)
          paint(screen);
     public boolean mouseDown(Event evt, int x,int y)
          if(numPoints <1000)
               numPoints++;
               drawX[numPoints] = x;
               drawY[numPoints] = y;
          repaint();
          return true;
     public boolean mouseDrag(Event evt, int x, int y)
          mouseDown(evt, x, y);
          return true;
}

Similar Messages

  • I am facing a Problem with reading images from database

    Hi everybody..
    any help will be most appreciated, I am facing problem with reading images from database. I am pasting my code... 
                    string connect = "datasource = localhost; port = 3306; username = root; password = ;"; 
                    MySqlConnection conn = new MySqlConnection(connect); // creating connecting string
                    MySqlCommand sda = new MySqlCommand(@"select * from management.add_products ", conn); //creating query
                    MySqlDataReader reader; 
                    try
                        conn.Open(); // Opening Connection
                        reader = sda.ExecuteReader(); // Executing my Query..
                        while (reader.Read())
                            byte[] imgg = (byte[])(reader["Picture"]);
                            if (imgg == null)
                                pc1.Image = null;
                            else
                                MemoryStream mstream = new MemoryStream(imgg);
                                pc1.Image = System.Drawing.Image.FromStream(mstream);
    It says Parameter not Valid... i am reading all the images from database

    I agree with Viorel. You are getting the error because the format of the data is incorrect probably because the data was modify. It may not be the reading of the database the is incorrect, but the application that wrote the data into the database. You need
    to compare the imgg array data with the data before it was written to the database to see if the data matches.  I usually start by comparing the number of bytes which is easier to check then compare the actual to isolate which function is changing the
    byte count.
    An image is binary data.  The standard VS methods for reading and writing data (usually stream classes) default to ASCII encoding which will corrupt binary data.  The solution usually is to use UTF8 encoding instead of the default ascii encoding. 
    Ascii encoding with stream often aligns the data and adds extra null bytes to the end of the data which can produce these type errors.
    jdweng

  • Memory allocation error with disk image

    I'm having recurring problems with a large encrypted sparseimage that I mount at /Users (an arrangement I prefer to FileVault.) The file contains one journaled HFS+ partition. Every so often, open files on the volume vanish or become unwritable. At the same time, I get a long series of messages in the system log of the form
    kernel[0]: disk4s2: memory allocation error.
    There's plenty of memory available. When this happens, I have to log out all staff users, then unmount and remount the image. When I do so, fsck finds corrupted i-nodes, which it's able to repair. All is then well for a few days, except that the files that were affected when the problem occurred are gone and have to be replaced. I've tried the obvious things many times: creating a new image file from backups, deleting kernel caches, etc.
    This looks like a bug in the HDI driver. I'd be thankful for genuine insight from anyone who actually knows something. Responses such as "Repair permissions" or "Reinstall Mac OS X" aren't needed. Thanks.
    Dual G5 2.5   Mac OS X (10.4.8)  

    Was probably a hardware issue.

  • Illustrator CC 2014 "Exception in file" error with linked images

    It appears some images are showing "Exception in file" error dialog boxes.
    If I resave the image in Photoshop or link it to a different image the error disappears.
    Happened with:
    - old design files linked to old images
    - image that was dragged from Mac Mail
    - linked to JPG provided from other users
    Does not happen with:
    - images created recently with Photoshop CC or CC 2014
    Here is the error:
    Has anyone else seen this and/or found a solution?
    This is an error on a new Mac Pro with brand new install of all software. No older versions of cc installed. Just CC 2014.

    That's a good idea. Unfortunately, same problem if I move the image to desktop or same folder as file.
    If I resave the file (JPG in this case) the error disappears.
    I understand this can be the solution, but given this issue had not happened before, it's interesting it is happening with CC 2014.
    Attached is the image in question. Note that this is not the only image. It has happened with older design files that were made from older versions of cc or before cc.
    I'm not sure if the uploader will recreate the JPG so I'll compress the file and is available here if anyone would like to test.
    Dropbox - photo 2.JPG.zip

  • Error 'Internal Error' with Reader X

    Hi,
    we got an "Internal Error" by opening PDF Documents wie Adobe Reader X. These Documents works fine with Adobe 9. We deteimined the error remaining on the jpg which is in the document. We created the jpg again an now we could open new documents with adobe reader x.
    Our problem is that all old documents have the old version of the jpg. Becouse of technical restrictions we aren´t able to creat the documents with the new jpg. We have to open the old pdf document with adobe X.
    Does anyone have an idea whats wrong with adobe x? Is it possible, that´s a knowen error and it would be fixed in the next version?
    Thanks for any help
    Regards

    Hello dbausnd2,
    It may not be your answer but I encountered the "internal error" message you described on some documents
    For me, disabling protected mode as described in following link solved it
    http://forums.adobe.com/message/3463596
    According to this, "protected mode" is a new feature in X, it could explain your 9.0, X behavior difference  http://blogs.adobe.com/livecycle/2010/11/technical-details-of-adobe-reader-x-protected-mod e.html
    Interestingly,  right clicking a file, selecting "Open with Adobe Reader X" would trigger "internal error" for me on the affected documents.  But right clicking, selecting "open with" and then "Adobe Reader" did not.  Go figure.  Also, opening from the reader's file menu worked.
    I imagine disabling protected mode reduces your system security, so that is something to consider

  • Problem with reading images in an applet

    Okay when i use Jbuilders applet viewer, my images load just fine, but when i use internet explorer to view the applet it finds the class files and tries to load the images, but has an error, so i look at the response from the java console, and it says there is problem reading the images - says their read only - so what? they arent anyway, and besides all im doing is reading them.
    Anyone know whats wrong? why does it display in the applet viewer in jbuilder but not in the webpage?
    Please respond to [email protected] Thanks

    I dont think that is the problem though, as mediatracker is just to ensure that before the paint method is called, the images are loaded instead of being loaded only once the paint method is called.
    I was thinking that it may be the fact that the application is not signed so there may be security violations in the browser but that should only apply when the files do not reside on the computer from where your calling it from.
    what do u think?
    Thanks

  • Error With Uploading Images for Content Manager

    Hi Guys
    I have tried to upload an image into Content Manager..... and on the concurrent request i get a failed error..+---------------------------------------------------------------------------+
    Content Manager: Version : 11.5.0 - Development
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    BULKUPLOADCP module: OCM BulkUpload Process
    Current system time is 04-AUG-2006 11:47:46
    java.lang.NullPointerException
         at oracle.apps.jtf.util.ErrorStackUtil.getErrorStack(ErrorStackUtil.java:82)
         at oracle.apps.jtf.util.ErrorStackUtil.fillDBErrorStack(ErrorStackUtil.java:163)
         at oracle.apps.jtf.util.ErrorStackUtil.fillDBErrorStack(ErrorStackUtil.java:151)
         at oracle.apps.ibc.admin.ContentItemManager.upsertContentItem(ContentItemManager.java:1776)
         at oracle.apps.ibc.admin.contentitems.server.BulkUploadCP.getItemsFromXMLFile(BulkUploadCP.java:518)
         at oracle.apps.ibc.admin.contentitems.server.BulkUploadCP.createItemsFolders(BulkUploadCP.java:269)
         at oracle.apps.ibc.admin.contentitems.server.BulkUploadCP.runProgram(BulkUploadCP.java:172)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:148)
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Executing request completion options...
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 04-AUG-2006 11:47:50
    this ist hte log

    Bumb thread. Please follow-up here: http://forums.adobe.com/message/4851765

  • Actionlist is missing error with Reader 9.4 on Win2008

    Hi All,
    The 3rd party SW that I need to install requires Reader 8 or 9 as a pre-requisite.  I need the UK option.  I can download fine from adobe.com/reader/download/otherversions (they certainly hide the older versions well).  However when I run the .exe on my server (on E: drive), I get the same Actionlist is missing error that others do.  The only solution appears to be to go to adobe.com/reader/direct, but that only allows me to download Reader X, which I can't use.
    I found a link to an ftp.adobe.com (looked legit) which had an .msi file.  When I ran that, buttons labeled in Russian appeared on a legit looking install screen.  I quickly shut it down, chosing the path of discretion.
    Any thoughts?
    Thanks,
    Ed

    There is an English version of Adobe Reader shipped by Adobe, which I guess is the one you are looking for.
    You can get the same from: http://get.adobe.com/reader/otherversions/
    Also, the FTP site that you tried, please try and access the en_US directory which has the English Reader that you want to install on your system.
    Thanks
    Ankit

  • Error with Reader 8.2.4 update package

    I get a Windows Installer error: This package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package.
    I am using this the same way I installed previous update packages such as 8.2.3.

    This sounds like a corrupted download. Download it again from http://ardownload.adobe.com/pub/adobe/reader/win/8.x/8.2.4/misc/AdbeRdrUpd824_all_incr.msp

  • Unsuported Image Format error with referenced images

    Hi,
    importing referenced images does not work for me: when selecting "store images in their current location" (i.e., referencing them), the preview is visible for a moment and then becomes gray; the large preview says "Unsupported Image Format" (if AP doesn't crash at all).
    When moving the same images into the library, it works fine. This applies to Nikon RAW (NEF) files (from a D70 and D2H) as well as plain JPEGs.
    I'm using Aperture 1.5.2 / OSX 10.4.8 on a Mac Pro; DigitalCameraRAWUniv200601.dmg is installed.
    Thanks in advance for any hints,
    Bernhard
    Mac Pro 2.66   Mac OS X (10.4.8)  

    Just if anyone cares (somehow this seems to be a rare issue), using referenced images seems to work if I choose a specific location ("Pictures") in the import dialog. The images get copied to a project-specific subfolder of ~/Pictures/ from where they are referenced, seems to work ok.
    BB

  • CS6 Rollover.js Error with Rollover Images

    Hello there,
    I've been trying to figure this out for days and it seems to be over my head.
    I've created png's for rollover images: one file called "up" and one called "over." Over is when the mouse is over the image, up is as it is normally.
    When I click "insert," --> "image," --> rollover image, I get this poppup box:
    I have tried to delete that cache file that's stored in the library, and it still won't work.
    I'm just trying to create a simple nav bar... I could use ul/li but I'd rather use images.
    Thanks!!

    Hi SnakEyes02,
    That could be. Let me know when you have grabbed these. They were Word docs that I saved the same way I always have done (Save As, Format: Web Page (.htm)), creating .htm files that work in CS5.5 Dreamweaver and earlier versions.
    http://test.babysneaks.com/WordHTML1.htm
    http://test.babysneaks.com/WordHTML2.htm
    Thanks for your help. Tim

  • RE: [Adobe Reader] when i open pdf file it open all the pages but some pages give error massage (there was error processing a page,there was a problem reading this document 110) but if i open this page which give me error with google chrome it's work ? i

    HelloThank's for your helpsI hope this document is helpfulBest Regards,
    Date: Sun, 22 Jun 2014 17:10:17 -0700
    From: [email protected]
    To: [email protected]
    Subject:  when i open pdf file it open all the pages but some pages give error massage (there was error processing a page,there was a problem reading this document 110) but if i open this page which give me error with google chrome it's work ? if you can help me th
        when i open pdf file it open all the pages but some pages give error massage (there was error processing a page,there was a problem reading this document 110) but if i open this page which give me error with google chrome it's work ? if you can help m
        created by Anoop9178 in Adobe Reader - View the full discussion
    Hi,
    Would it be possible for you to share the document?
    Regards,
    Anoop
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6485431#6485431
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
         To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Adobe Reader by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

    thank's for reply and your help
    i did the step's that you told me but  i still have the same problem
                                     i have the latest v.11.0.7
    i
    i disable the protected mode

  • PSCS4 Memory Error with Image Processor

    When I use the image processor in PSCS4 to process a large number of raw files using ACR 5.1 (Nikon D3 NEFs), I consistently receive an error message after about 10-11 files have been processed that the instruction at 0x696336ab tried to read memory at 0x6C (or thereabouts) and the memory could not be read. I am saving as JPEGs with the color space set to sRGB.
    I de-installed and reinstalled PSCS4, but the error persists. The image processor worked fine with PSCS3. A workaround that solves the problem is to process the files as a batch using a simple action to accomplish the task.
    I am running Windows XP Pro Service Pack 3 with a dual Xeon processor and 2G of error correcting memory.

    Hmm.. I was getting a similar error with CS3 and was very happy to find that it appeared to be cured in CS4. The CS3 issue would appear if I tried to process more then 100 NEFs. My workaround was to do them in smaller batches (60-75). Perhaps you might try reducing the memory alotted to PS or run it without any other apps running?
    Russell

  • Read Image File Error

    When I read image with Read_Image_File procedure i got an error in specified files 'FRM-47100 can not read image c:\abc.jpg'
    i think it is on high resolution please promply resolve it. its very urgent
    best regards
    R E H AN M I R Z A

    Hello,
    Found this on Metalink:
    Problem Description
    You are trying to use READ_IMAGE_FILE in forms to read a JPG image,
    but you receive the following error:
    FRM-47100: Cannot read image file <file name>
    You checked the following:
    o You are able to open the image file from Netscape or Internet Explorer and
    see your image correctly.
    o You are also sure that the file exists under the location mentioned in the
    first parameter to READ_IMAGE_FILE built-in.
    o You tried other JPG files that are located in the demo directory of the
    Developer home and you can see the image loaded in the image item.
    Solution Description
    There are many JPEG formats. The only JPEG format supported in Forms is the
    JPEG File Interchange Format (JFIF) which is the baseline sequential DCT JPEG.
    Progressive JPEG (as well as Lossless JPEG and Hierarchical JPEG),
    are not currently supported.
    Possibly your image file is stored using one of the non-supported formats.
    As a workaround, you can convert progressive JPEG format to and from baseline
    JPEG. There is a free set of programs provided by the Independent JPEG Group
    that allows this.
    The Independent JPEG Group home page is: http://www.ijg.org/
    Francois

  • For the last 2 days whenever I try to upload photos from my iPhoto page to facebook I get an error message: Bad Image There was a problem with the image file.  I haven't knowingly changed any settings on iPhoto or facebook. Can anyone help, please ?

    I need help with uploading photos from iPhoto to facebook. I could do it till 2 days ago. Now any new photo I try to upload gives me an error message:
    Bad Image
    There was a problem with the image file. 
    Please help.

    Can you drag it to the Desktop?

Maybe you are looking for

  • How can I get to home screen from car dock menu when an app is running?

    Just upgraded to the RAZR MAXX from a Droid 2 Global. When the phone is mounted in the car dock and an app is running (Navi, Music, etc.), how can you get to the main home screen of the phone rather than the car dock menu? Follow me...... * Phone is

  • Iphone 6 back logo is not uniform color

    Space grey iphone 6; back metal logo is not pure black. the middle is pure dark black and the edge is a little bit lighter. anyone has the same issue? I will post picture later on PC

  • Ad-blocker is not blocking Firefox ads. Is there a way to block these ads from the Firefox home page?

    Whenever I open a new Firefox window there is a new Firefox ad. AdBlocker Plus does not seem to block Firefox ads. All ads are annoying. Period. Even yours. Is it possible to block these ads? Please advise. Thanks!

  • N95-1 V31.0.017 SMS Error

    After updating to the new firmware, i cannot read or view any messages which are and were previously stored on my memory card.  I've reinstalled the firmware twice & i've hard reset three times but i've not idea what to do next. I just can't access t

  • About SQL Form 3.0

    Dear all, I just want to ask that, in SQL Form 3.0, we can create some frames in the painter for having better displaying effect. What key combinations can we use for having those frames? For instance, what key combinations do we use for having a big