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

  • SEARCH
  • Home
  • 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 233463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:06:11+00:00 2026-05-11T20:06:11+00:00

I want to make an Applet write to a text file. I think have

  • 0

I want to make an Applet write to a text file. I think have overcome the security problem with my own certificate, but the text file isn’t receiving the output.

My Applet can be seen at tomrenn.com/fallball, and should ask if you trust the certificate.

I’m not sure an Applet can write to a text file within the web hosted contents, so I’m asking if this is possible; and if not, at least be able to do it on the local machine. I had been using a FileOutputStream, but my teacher recommended this very basic output method.

public void writeToFile()
{
  try {
     java.io.File file = new java.io.File("highscores.txt");
     java.io.PrintWriter output = new java.io.PrintWriter(file);
     output.print(name + " " +score);
     output.close();
  } catch (IOException e) {
     System.err.println ("Unable to write to file");
     System.exit(-1);
  }
}

This is not what I would be implementing, just trying to see if I get any output. Thanks for looking over my question!

  • 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-11T20:06:11+00:00Added an answer on May 11, 2026 at 8:06 pm

    From an Applet, you cannot directly write to the server’s file system. You can issue a request to the server that causes the server to write to its own file system, but an Applet does not have a way to write to a file system on a remote machine. (Of course, unless it’s mounted NFS or otherwise.) To issue such a request, you could use Apache HttpClient to issue HTTP requests, for example. This may be more heavyweight than you are looking for. You can also have the client issue a POST to the server to say, “This is my high score,” and let the server manage high scores.

    A signed Applet has every right to write to the local file system of the person running the Applet. If you are writing to the “current directory” (rather than an absolute full path), then make sure you know what directory the Applet is running in. Otherwise you may indeed create a file, but not be able to find it!

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

Sidebar

Related Questions

I have an applet that I'm running online and I want to make sure
I have a java applet, I want to make sure that nobody use it
I have a wireless IP camera and I want to make my own web
I want to make a tray applet using Qt that will use an output
I have style sheet with a class name changebackgroundcolor i want make change in
I have link for example domain.com/de/controler/action?param=value and I want make actionlink to keep same
I have written a powerful trig calculator, but I want to use the linen
I want to make a ca concurrent applet. What I'm trying to do is
I'm building my own String class and I want to write my own replace
I'm writing an applet and want to figure out how to make a button

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.