Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

eatpie26

macrumors newbie
Original poster
Jan 4, 2011
21
0
I'm sorry if this is in the wrong section, but I didn't know where else to put it. I am making a game with Java, and I want the user to be able to save they're progress on their computer. In order to do this, I want to create a new type of file to save it as such as .doc or .ppt. I apologize if this is a stupid question, but how do I make a new file type to save the game data? I am using Mac OSX 10.7.
 
Last edited:

eatpie26

macrumors newbie
Original poster
Jan 4, 2011
21
0
I'm not making a Java app. It's just a program written in Java. I know it's possible to make a new file type, but I'm not sure how. If anyone knows, please tell me.
 

eatpie26

macrumors newbie
Original poster
Jan 4, 2011
21
0
I am making the file as a jar-file. Which method should I use for that?
 
Last edited:

ulbador

macrumors 68000
Feb 11, 2010
1,554
0
The save file will still be in an external directory somewhere. As far as the format of the file, most people would just open up a file descriptor and come up with a custom format.
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
I'm sorry if this is in the wrong section, but I didn't know where else to put it. I am making a game with Java, and I want the user to be able to save they're progress on their computer. In order to do this, I want to create a new type of file to save it as such as .doc or .ppt. I apologize if this is a stupid question, but how do I make a new file type to save the game data? I am using Mac OSX 10.7.

1. I bet you are _not_ using Mac OSX 10.7.

2. The easiest way to do this without causing any problems to anyone, and at the same time the correct way, is to create a folder for your application inside the "Application Support" folder. There is no reason whatsoever to give this file any particular file type. Just write a plist, or an xml file, or a plain text file, whatever you prefer.
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
Sorry. That was a typo. Also, where is the application support folder?

Ahem...

It is called "Application Support". It is in the user's home directory, in the "Library" folder. Have a look at what folders you find in your "Library" folder; for example, there is a folder where you should put your Preferences file. There are methods in Cocoa that give you the proper path, but if there is nothing in Java, then you should just access "Library/Applications Support" in the user's home directory.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.