Displaying the content of a zip inside JTree?

M

Math55

Hello, how can I display the content of a zipfile inside a JTree?
I am reading the zip like that:

---
try {
// Open the ZIP file
ZipFile zf = new ZipFile("filename.zip");

// Enumerate each entry
for (Enumeration entries = zf.entries(); entries.hasMoreElements();) {
// Get the entry name
String zipEntryName = ((ZipEntry)entries.nextElement()).getName();
}
} catch (IOException e) {
}

---

Can you help me?

Thanks
Andreas
 
C

Chris Smith

Math55 said:
Hello, how can I display the content of a zipfile inside a JTree?
I am reading the zip like that:

ZipEntry.getName returns a full name, include slash-delimited path
components. You'll need to use StringTokenizer to get a list of the
path components, and organize that into a tree structure on your own.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top