[SOLVED] Jme3 Beginner: Can Nifty Create a File Browser Menu?

Hello all,



I want to create a menu, maybe using Nifty if that’s a good approach, where I can open up a trace file I want to read (just like you’d do in swing but more in a gaming style - so maybe Nifty).



Now I read the file using something like this:



[java]String url = “C:\Users\garnaout\Desktop\Accurev_workspace\JSLDriveModel\LayoutFile\cinematics3d.atf”;

[/java]



but i’m looking for a fancier way by running the animation and maybe use a Nifty menu to locate the file and open it.



any ideas?

Anyone ? help :confused:

Nifty isn’t a file manager. :slight_smile: You’d be better off using asset manager to load that file or another way, maybe iostream or something like that.

but I want a nice menu (swing like) to initiate it. Thought Nifty would do such a thing.

I might be wrong on that, but Nifty rely entirely on the engine it runs on for files. There might be some file accessor method. I’ve never looked for that.



If you wanted you could create a “File Manager/Browser” with nifty, but all its information would need to be gathered by jME. Nifty can’t do what you’re wanting to achieve unless I misunderstand your goal.

If you wanted you could create a “File Manager/Browser” with nifty, but all its information would need to be gathered by jME. Nifty can’t do what you’re wanting to achieve unless I misunderstand your goal.


I think that's exactly what I am trying to do. I need to fill in variables inside Jme (nothing loaded from the outside except the user input). I want the user to be able to set the speed of the animation, the duration, read a trace animation trace file that my Jme program is already able to parse etc etc (all variables within JME)

How would I go about creating something like that?

you could create a file browser (like the one in Swing) with nifty. There currently is no tree in nifty, so you’ll have to find a way around that as well.



I would suggest using the standard java.io for discovering the folders and the file listings in the folders, for actually loading of the files you would use the asset manager like @madjack said.

The reason you need to use standard IO for the listing part is that neither JME nor Nifty has facilities that support file discovery like that.

I guess i’m better off then just doing it in Swing and forget about being all flashy :wink:

For the moment, probably. But this isn’t to say Nifty won’t have one of those controls eventually.



You could even make a file browser control yourself and submit it either to me or to Void. Then we can look at it and decide if we are going to add it to the Nifty-Default-Controls jar.

will do.



thx guys

Well, here’s an idea. I’ve never ever used Swing so I don’t know if that’s possible but if you can make a Swing window invisible or 100% transparent you could “hack” the information needed to fill nifty with what you want with that transparent window. I imagine Swing has methods to get all the info you need since you’re contemplating using it for that.



Just dismiss that idea though as I’m sure it’s not worthwhile. :roll:

yeah the thing is I am trying to add Nifty just to make the animation more flashy. I would consider implementing it (cuz the idea would be cool to have a nifty file browser), but definitely would be a low priority as this point.

If I can find the time after adding the tab control to Nifty, I’ll see what I can do, ok?

Great :slight_smile:



Thanks!!