Drawing outside a component's bounds

后端 未结 1 815
日久生厌
日久生厌 2021-01-18 18:49

I\'m making a component (extending JComponent) which will have some decoration drawn over the top of it and partly outside its bounds.

I would like to know if there\

相关标签:
1条回答
  • 2021-01-18 19:22

    AFAIK, there is no easy solution. One way to achieve this is to draw on the container's GlassPane, as shown here. IMHO, I would just modify the Graphics object of the component to change the "apparent" bounds, which will enable you to draw stuff that's "outside the bounds" on the component itself.

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