A SwingNode is like a top-level window for the embedded Swing content. If it were a real top-level (e.g. a JFrame), the Swing content would always occupy the whole area of the window and would be responsible for painting each and every pixel of it.
In order to avoid dealing with empty areas, and also to make the Swing content "feel" natural when placed into a SwingNode, we should ensure the same for the SwingNode. It is the SwingNode size (from FX layout perspective) that should determine the size of the Swing content at any time. If it doesn't fit, Swing should paint the empty areas (e.g. by means of rendering the background of the parent component into which the Swing content is added).
Also seeRT-37810 for some comments on this.
In order to avoid dealing with empty areas, and also to make the Swing content "feel" natural when placed into a SwingNode, we should ensure the same for the SwingNode. It is the SwingNode size (from FX layout perspective) that should determine the size of the Swing content at any time. If it doesn't fit, Swing should paint the empty areas (e.g. by means of rendering the background of the parent component into which the Swing content is added).
Also see
- relates to
-
JDK-8097328 [SwingNode]: Swing Nodes have serious rendering artifacts when first displayed on the primary Stage
-
- Resolved
-