且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在java屏幕上显示鼠标坐标的问题

更新时间:2022-10-30 11:17:52

You're drawing on your graphics area, so g.drawString(...) draws a string on top of what is already there. You must either erase what is there first, by drawing a rectangle in the background colour, or use a separate component that you can manage with a separate paint(...) method.