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

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top