当前位置: 动力学知识库 > 问答 > 编程问答 >

swing - Java: JList rendering effect

问题描述:

I have seen this effect for a list in my Netbeans. Can somebody tell me what this effect is called and how I can implement it in my custom ListCellRenderer?

Thanks for your help.

Andy

网友答案:

The closest thing you can do is use a "tooltip". This is done by:

  1. invoking the setToolTipText() method in you renderer, or
  2. overriding the getToolTipText() method of the JList.

Normally the tool tip appears below the mouse location. You can also override the getToolTipLocation() method to position the tool tip over the current row to more closely mimic the netbeans behaviour.

分享给朋友:
您可能感兴趣的文章:
随机阅读: