Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试创建一个JToolTip超过JPanel. 这个想法是,用户在 J 上移动,Panel (mouseMove)光标后面将是工具提示。但我不知道,如何将工具提示设置为JPanel. 我的意思是,我通过光标(in )创建了 的实例JToolTip,然后我不知道如何将这个新的工具提示设置为面板(如)。setLocationmouseMoveJPanel.setToolTip(newJToolTip)
JToolTip
JPanel
Panel (mouseMove)
setLocation
mouseMove
JPanel.setToolTip(newJToolTip)
JPanel您可以在using上设置工具提示setToolTipText()。当鼠标光标停止时,将显示工具提示。如果您不再需要此行为,只需再次调用该方法null作为参数。
setToolTipText()
null