我已经创建了弹出框,当鼠标指针放在按钮上时,它是可见的。
但是弹出框显示在屏幕的左上角。
如何以按钮工具提示的形式弹出?
发布于 2012-02-15 17:46:14
你用谷歌搜索过那个"JButton工具提示“吗?这是first hit with an example:
关于弹出框在左上角;它显示在默认位置(0,0)。您可以使用setLocation()方法设置它的位置
setLocation()
2:https://web.archive.org/web/20130715065613/http://docs.oracle.com:80/javase/1.4.2/docs/api/java/awt/Component.html#setLocation(int,整型)
https://stackoverflow.com/questions/9290954
相似问题