Forums Register Login

list of JPanels for a download manager

+Pie Number of slices to send: Send
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.

Matt
+Pie Number of slices to send: Send
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.
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1230 times.
Similar Threads
Dynamic JTable column sizing with horizontal toolbar
JTable
Wanted: conceptual tutorial on JTable
JTable
ListSelectionListener in JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 21:43:43.