Beyond Components

I am creating a component (extending the JComponent) that will have some decoration drawn on top of it and partially outside its borders.

I would like to know if there is a way to draw outside the component using stand-alone code (for example, I don't want to do any drawing in the parent container).

+4
source share
1 answer

AFAIK, there is no easy solution. One way to achieve this is to use a GlassPane container, as shown here . IMHO, I would just modify the Graphics object of this component to change the "visible" borders, which allows you to draw material that is "outside" on the component itself.

+2
source

Source: https://habr.com/ru/post/1379188/


All Articles