Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] java file !?

Started by role Jan 6, 2003 at 3:00 AM 2 replies 250+ views
Original Post
role
role
i generate my map from a file it works many times but sometime there are many blank tiles i suppose the problem is because the map generated from unfinished file read is there any way to wait file reader finished her task before use the file? (like MediaTracker for Image & Sound) and how to change file extension?? i want my map file extension is ".dat", and i have used FileFilter in JFileChooser, it works in JFileChooser, but when i get the file using fileChooser.getSelectedFile(), why it doesn't have any extensions?!? thanxx [edited by - role on January 8, 2003 6:28:43 AM]
role
role
doh.. no one can help me?
it''s not a big problem indeed.
but it''s really annoying me!

make me sick!!
role
role
doh.. no one can help me?
it''s not a big problem indeed.
but it''s really annoying me!

make me sick!!
Petr Stedry
Petr Stedry
File not completely read in issue:
I'd suggest read THE WHOLE FILE before you do something with the data you pull from the InputStream (for example check for end of stream).
Maybe a method, that does not return until loaded, helps ?

JFileChooser issue:
If the File object exists() returns true, why bother checking the file extension. BTW File object.getName() returns the name (everything after the last directory name, so the extension should be there also ?
And read the API javadoc next time more thoroughly before posting please.

and have fun ...

Petr Stedry

[edited by - Petr Stedry on January 8, 2003 2:06:21 PM]
Petr Stedry

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.