我有以下代码来获取JList项目的提示文本:
JList aList=new JList(aData)
{
public String getToolTipText(MouseEvent evt) // This method is called as the cursor moves within the list.
{
String tooltipText="Some tooltip";
int tooltipWidth= ?
return tooltipText;
}
}
在getToolTipText()函数内部,我要如何获取tooltipText的宽度?
第一行
下方加下划线或<hr>
标签。无论哪种方式,都可以使用 CSS 进行进一步调整。您也可以考虑使用 CSS 限制宽度,而不是使用硬换行。 - Andrew Thompson