doSaveAs() for text

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
ValeriGFZ
Posts: 5
Joined: Thu May 24, 2012 3:47 pm
antibot: No, of course not.

doSaveAs() for text

Post by ValeriGFZ » Fri May 25, 2012 1:11 pm

Hello everyone,

The method ChartPanel.doSaveAs () saves the PNG file.
I need to save a text file from an applet.
Since ChartPanel.doSaveAs () runs in an applet,
should be possible to save a text file.
How can I do this?

Thanks in Advance

remiohead
Posts: 201
Joined: Fri Oct 02, 2009 3:53 pm
antibot: No, of course not.

Re: doSaveAs() for text

Post by remiohead » Fri May 25, 2012 1:30 pm


ValeriGFZ
Posts: 5
Joined: Thu May 24, 2012 3:47 pm
antibot: No, of course not.

Re: doSaveAs() for text

Post by ValeriGFZ » Fri May 25, 2012 7:28 pm

Hello, remiohead.
Thanks for the quick reply, but it's not what I need.
Look at the bottom of the page:
"Security consideration ... The example programs contained in these lessons are standalone applications, which by default have no security manager."
I have an applet.

All the best.

remiohead
Posts: 201
Joined: Fri Oct 02, 2009 3:53 pm
antibot: No, of course not.

Re: doSaveAs() for text

Post by remiohead » Fri May 25, 2012 7:41 pm

I believe so long as you sign your applet you can request full security permissions and read/write to the local disk. There are tonnes of tutorials on this subject on the web.

ValeriGFZ
Posts: 5
Joined: Thu May 24, 2012 3:47 pm
antibot: No, of course not.

Re: doSaveAs() for text

Post by ValeriGFZ » Sat May 26, 2012 11:32 am

sorry, remiohead,
i don't need "i belive ...", i need "if ... then... else" and so on.
At least I need a TextWriter or IO.StreamWriter Object, which sits somewhere in org.jfree.chart.ChartPanel.

Hello World, any idea, please!

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: doSaveAs() for text

Post by John Matthews » Sat May 26, 2012 4:46 pm

See also What Applets Can and Cannot Do. Alternatively, consider Java Web Start for deployment.

ValeriGFZ
Posts: 5
Joined: Thu May 24, 2012 3:47 pm
antibot: No, of course not.

Re: doSaveAs() for text

Post by ValeriGFZ » Sun May 27, 2012 7:40 am

John Matthews wrote:See also What Applets Can and Cannot Do. Alternatively, consider Java Web Start for deployment.
is not an idea, I can also google.

remiohead
Posts: 201
Joined: Fri Oct 02, 2009 3:53 pm
antibot: No, of course not.

Re: doSaveAs() for text

Post by remiohead » Mon May 28, 2012 4:54 pm

If your applet is unsigned or not deployed via JNLP you cannot write to the filesystem. That is exactly what the sandbox is there to prevent. Since this isn't even JFreeChart related I suggest you take this topic to another forum.

ValeriGFZ
Posts: 5
Joined: Thu May 24, 2012 3:47 pm
antibot: No, of course not.

Re: doSaveAs() for text

Post by ValeriGFZ » Sun Jun 03, 2012 3:31 pm

:cry:

Locked