Browse Directory

35 views
Skip to first unread message

IHateSoda

unread,
Jan 10, 2012, 8:08:15 PM1/10/12
to gwt4air
Hi,

I'm trying to implement gwt4air because I need to browse directory, I
see in the sample code that it's possible

File file = File.getDesktopDirectory();
file.browseForDirectory("Choose a Directory");

file.addEventListener(Event.SELECT, new AIREventListener<Event>() {

@Override
protected void onAIREvent(Event event) {

// debugging
Runtime.trace(event.getTarget());

File directory = event.getTarget();
JsArray<File> filesInDirectory =
directory.getDirectoryListing();

String message = "The following files are in the directory: ";
message += directory.getNativePath() + "\n\n\n";

for (File f : filesInDirectory) {
if (!f.isDirectory() && !f.isHidden()) {
message += "Filename : " + f.getName() + ", Size : ";
message += (Math.round(f.getSize() / 1024)) + " KB
\n";
}

Window.alert(message);
}


}});

But I don't know to implement in my gwt application.

Need help plz

Best

cirquent hacker

unread,
Jan 11, 2012, 10:54:00 AM1/11/12
to gwt...@googlegroups.com
This group is no longer supported.
Please post your question on the link below and  we ll try to help you asap.
http://www.emitrom.com/forum/56
Thx
Reply all
Reply to author
Forward
0 new messages