On 4/6/20 5:07 am, Prasanta Sadhukhan wrote:
tip = insideComponent.createToolTip();
tip.setTipText(toolTipText);
+
+ System.out.println("default gc " + gc.getDefaultTransform());
+ System.out.println("insideComponent GC " +
insideComponent.getGraphicsConfiguration().getDefaultTransform());
+ GraphicsConfiguration oldConfig = tip.getGraphicsConfiguration();
+ System.out.println("tip oldgc " + tip.getGraphicsConfiguration());
+ GraphicsConfiguration newConfig = tip.getGraphicsConfiguration();
+ if (newConfig == null) {
+ newConfig = GraphicsEnvironment.getLocalGraphicsEnvironment().
+ getDefaultScreenDevice().getDefaultConfiguration();
+ }
+ System.out.println("newgc " + newConfig);
+ if (newConfig != null) System.out.println(" transform " +
newConfig.getDefaultTransform());
+ tip.firePropertyChange("graphicsConfiguration", oldConfig,
newConfig);
+
+
size = tip.getPreferredSize();
+ System.out.println("tip preferredsize " + size);
I think it is necessary to inject the "insideComponent"'s GC to the tip
somewhere in the .createToolTip() and use this GC by default in the tip, for the test we
can try to override getGraphicsConfiguration() in tip and return
component.getGraphicsConfiguration().
BTW did you notice that in the test when the size of the frame are changed from bigger to
smaller by the "space" key the tooltip usually cut as well? Probably we need to
change the type of the tip on the fly? from LW to HW?
--
Best regards, Sergey.