Results 1 to 5 of 5
Thread: hello first.....
- 03-30-2010, 01:51 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 13
- Rep Power
- 0
hello first.....
then i am trying to develope application smiliar "windows explorer" with netbean....
i have one file array (.listfiles) and one string array(.files)...geting from same directory.....
i want to separete string array two part with usuing file array.....
one is visible files...second is subdirectories....
subdirectories will be item of treebox.....visible files will be item of listbox....
my problem is enlarge these files and sundirectores arrays on runtime...and adding new value to them....
best regards
- 03-31-2010, 03:25 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
You cannot increase the size (length) of an arrays dynamically, a string array for example. So what we could do? Read about collections in Java.
Lesson: Interfaces (The Java™ Tutorials > Collections)
There are some tricky ways to do dynamic sizes handling in Java, bit not safe at all. So I suggest you not to go for such things.
- 03-31-2010, 11:20 PM #3
Member
- Join Date
- Mar 2010
- Posts
- 13
- Rep Power
- 0
i am trying ...
to copy existing array to new create temp array.....
create first array again with one more length.....
copy back array from temp to enlarged array....
but this is not work exactly.....
any one know more easy solution of tthis.....
-
Eranga has already given you the solution to variable sized arrays: Collections such as an ArrayList.
- 04-01-2010, 03:34 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks