I´m trying to make something similar to the downloads panel of Transmission BT (here an image: http://www.transmissionbt.com/images/screenshots/Mac-Large.jpg) but I´m having some problems. I made a JPanel with the progress bar, labels, icon and buttons开发者_C百科 and then added this panel to a container (JPanel again) but I need to make this component selectable.
How can I do this?
You can simply use JList
and ListCellRenderer
to render your existing panel in a JList .
Dont you think A table would be easier with this? It has al the functions you need. JUst create a table on a FRAME and then remove the headers so you just have the table. In this was you can easily handle what was selected..
Another way is to use a grid layout that changes on each addition and then each section of the column grid should have a panel. Each panel should have a mouse listener for a click. When clicked you just change the background color.
They are stil more ways of handling this so these are just two.
Goodluck
精彩评论