Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

I/O and Streams  RSS feed

 
Ayelet Il
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to java, please help...
I would like to get a list of directories from a Drive
and post it into a list component.
How do I do that?...
Thanks in advance.
 
raghavender rao
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ther,,,

try this code
File f = new File("/space/");

String ar[] = f.list();

java.awt.List l = new java.awt.List(ar.length,false);

for(int i=0;i < ar.length;i++){


l.add(ar[i]);


}


add(l);

hope this wil help u...

Rao

[This message has been edited by Marilyn deQueiroz (edited October 05, 2001).]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!