File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes list of JPanels for a download manager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "list of JPanels for a download manager" Watch "list of JPanels for a download manager" New topic

list of JPanels for a download manager

Matt Zollinhofer
Ranch Hand

Joined: Jul 09, 2004
Posts: 33
I have a JPanel that monitors and displays the progress of a thread that downloads and then encodes an audio stream. I thought it would be a nice touch if instead of having a bunch of windows popup showing this information, I could just have one frame with all the panels in a list. As more downloads begin, the list would just add another item (panel). It would like much like this (a screenshot of the Mac OS X safari download manager) screenshot, but with more/different information.

You can't simply put a JPanel in a JList (which I tried ), and JSplitPane only supports two panes. I was thinking maybe a JTable or a JScrollPane would work, but I am having some trouble working through how to go about doing something like that. I think I'd have the same problem with the JTable as I did with the JList, and I can't quite figure out how to work with the viewport to do this sort of thing.

Joe Ess

Joined: Oct 29, 2001
Posts: 9189

Looking at the screenshot, what you want to do is create a custom cell renderer for a JList. There's an example in the Java Tutorial. Though the example is uses a Combo Box, JList uses the same renderer, so the code is very similar.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: list of JPanels for a download manager
It's not a secret anymore!