Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3673086
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:41:21+00:00 2026-05-19T02:41:21+00:00

I have been struggling with an issue involving a Processing sketch which I want

  • 0

I have been struggling with an issue involving a Processing sketch which I want to use to create an image file (to a server-side directory). In the Java, I use a PImage of the canvas, converted to a BufferedImage, which is then created as a file via ImageIO.write.

It creates the file successfully when run as a sketch on my system, file.png appears in the same folder as the program. The problem is that when the program is exported as an applet, it no longer creates the file. It would be huge if anyone had any input as to why the sketch of the program can create the image but the applet cannot.

Here’s a couple snippets of what I’m using if it’s of any help. Thanks all.

PImage pimg = get();
BufferedImage canvas = convertToBufferedImage(pimg);
File file = new File("./sketch/file.png");
try
{
  ImageIO.write(canvas, "PNG", file);
}
catch (Exception e) { println(e); }

And here’s the method that’s converting the PImage to a BufferedImage.

BufferedImage convertToBufferedImage(PImage pimg){
    PGraphics pg = createGraphics(width, height, JAVA2D);
    pg.image(pimg, 0, 0);
    BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB_PRE);
    Graphics2D g2d = img.createGraphics();
    g2d.drawImage((java.awt.Image)pg.image, 0, 0, width, height, this);
    g2d.finalize();
    g2d.dispose();
    return img;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:41:22+00:00Added an answer on May 19, 2026 at 2:41 am

    I think it’s just applet security restrictions preventing you from modifying the filesystem on the client machine.

    Take a look at FileSaveService in JNLP. This can be used from an unsigned applet to save a file to the filesystem on the client machine.

    If you are trying to write to a directory on the server from an applet, you cannot do this directly. You would need to create an upload form on the server and maybe use HttpURLConnection to send a POST request to the server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been struggling to create a django form which users can fill and
I'm new with ruby and rails and have been struggling with this issue for
been struggling with an issue now for a day or two. I have an
I've been struggling with this issue for a while now. I have OpenCart 1.5.2.1
I have been struggling with setting up an iOS (Objective-C) app which utilizes the
I have been struggling with what I feel is a simple JQuery selector issue,
I have been struggling with this issue for one week, and still far away
I have been struggling with this problem on hostgator shared hosting server for the
I have been struggling with this issue for 3 hours. I know I can
I have been exploring this issue for the first time and I am struggling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.