ToolTip flicker in Java if outside JFrame?

后端 未结 1 530
失恋的感觉
失恋的感觉 2021-01-26 13:15

I am implementing ToolTip in Java as to make users having an easier time to use the product. Though tooltip that are at the borders of the JFrame and ends up outside the JFrame

相关标签:
1条回答
  • 2021-01-26 13:54

    When a tooltip is displayed in a JFrame, Swing does not create a floating window, it simply paints the tooltip in the graphic context of the JFrame. This does not generate any flickering. On the other hand, when a tooltip is outside the boundaries of the JFrame, it becomes heavyweight: a window is created to host the tooltip component. Flickering occurs when the tooltip window appears.

    Maybe setting "-Dsun.awt.noerasebackground=true" would help because it prevents one step of background repainting of the hosting window.

    0 讨论(0)
提交回复
热议问题