Hi guys,
I might need to open files within my JME app and the natural choice for that is by a file chooser popup. (See f.e. http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html.
I couldn’t find such a component in the GBUI documentatiom. Is there such a component? If not, any tips on implementing it myself?
There is not such a component in GBUI currently. The easiest way to do so is actually break down the component pieces of the overall component that need to be implemented…these would include File objects to show the directories and files…some sort of visual component to display what your File objects returned, listeners to determine mouse clicks on one of the visual components that then tell it which one you've selected, if it's a directory then you are going to want to open and not just select. There's a bunch more to go on with this type of overall component that I've not even started to get into.
I'll work on a basic design doc for the component and then post it here for commentary as well on the gbui task portion of the site and notify the other devs to see if they have any suggestions…by that time I'll have already built a basic framework that can be used and then we'll modify it.
I'll post something later tonight or tomorrow. Then I'll also make a note that I'll need to write documentation on it too
actually, even simpler, although not as pretty…I don't know why you couldn't just use the file chooser directly. I've not checked out the whole API, but I don't know why it wouldn't work or couldn't work…I'll check it out and let you know
Due to snow the last two days I didn't have a chance to get to this - I left my computer at the office (DOH!)
I'm working on the concepts now, should have an idea by the end of the day
Ok, I have a temporary solution for you. It combines Swing and GBUI together.
http://code.google.com/p/gbui/source/browse/trunk/test/java/com/jmex/bui/BFileChooserTest.java
Basically, you'll have to manipulate some of the variables for the File, but you can then get your name, path, etc from that object and open or save or whatever you want.
This isn't my optimal solution, but it will work for now. lemmie know if you need more help on this.
I'm sorry that I cannot give a detailed reply, as I am quite busy with other stuff right now, but I want to thank you Standtrooper, for your quick and excellent responses to my questions. I will try out your suggestions as soon as possible, I'll report how it turns out.
Thumbs up for the great JME community!