Java swing – JList custom cell rendering – capture operation

Whenever I create a custom cell renderer for JList, any elements I add to it will not respond to the operation For example, if I ask the cell renderer to return a JPanel with elements, one of which has an actionlistener, it doesn't respond at all

Why?

Solution

Items returned as list cell renderers are for: rendering only Register listeners using JList (usually, you need a listselectionlistener)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>