Paul Clapham wrote:Okay... then does that mean you want one of the entries in the list to be a JScrollPane, instead of the usual JLabel? Or do you want all of them to be a JScrollPane? The code you posted doesn't say anything about that. (In fact it really doesn't tell me anything except that you are using a JList.)
Anyway, here's a link to the JList tutorial. It has a section about how to use custom renderers, which is the official answer to your question. It just seems like a really strange UI design to me. Did you really mean to ask that?
Thank you ! The code I posted creates a JList,but if the items it contains are many,some items cannot display.So I want to add a JScrollPane,for instances:(attachments)
Look forward to your reply.