Java- How to set setToolTipText for JFrame
问题 I would like to move the mouse over an image which was plotted on a JFrame using g2D.drawRenderedImag and display the x, y of that pixel at the tooltip text right next to mouse cursor. i.e: Graphics2D g2D = (Graphics2D)g; g2D.drawRenderedImage... I know how to read the x,y but don't know how to set setToolTipText for a JFrame. Can you guys help me please? I mean I can not do like this JFrame.setToolTipText !!!! 回答1: you can do componentName.setToolTipText("context"); for more information, you