Hi Guys,

I'm filling a JTree with user system files/folders and I'm using the File class for this purpose.
I noticed the JTree displays also hidden & system files which will confuse the user of my application.
I first thought to use some File method & isHidden() was first candidate.I first tried

return file.isHidden()

but that's not working ..i tried

return !file.isHidden()

which seems to do better but I'm still incapable of solving this issue.
I'm planning to use Runtime.exec() but don't know what commands to use to check system & hidden files .this should take in consideration the OS windows or Mac.I think this checking should be OS centric as i guess there is No cross Platform way to solve this issue ?
am I right ? or is there any way in Java to check if a given File Object is a system file and/or a hidden file?

can some one suggest me a good and simple solution for this problem ?