This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi all, In my application, I am using a font resource(TTF file), which i load using
InputStream in = getClass().getResourceAsStream("ARIALUNI.TTF"); Font font = Font.createFont(Font.TRUE_TYPE,in);
Every time, I use this resource, a temp file named "+~JFxxxx.tmp" is created in the TEMP directory. This happens even when the app is deployed as a jar. Can anyone let me know, if this can be avoided or how to remove these temp files when the program terminates.
As the javadoc states for createFont method, this method does not close the inputStream. If you have a close() method that is called when you close your application, you coud close the stream and the temp file should disappear.
Pradeep Kumar T
Joined: Apr 14, 2007
Thanks for the reply. I have already closed the stream using the close method, but according to the javadoc it(InputStream's close()) has no implementation. Is there any other way for this. Thanks again.