Thanks Phil for your review. It was added to by IDE, anyways rectified it

http://cr.openjdk.java.net/~psadhukhan/8213535/webrev.6/

Regards
Prasanta
On 30-Apr-20 2:08 AM, Philip Race wrote:
34 import java.awt.*; just for one class :
170 GraphicsConfiguration tipConfig = this.getGraphicsConfiguration();

-phil.

On 4/20/20, 11:14 AM, Prasanta Sadhukhan wrote:

On 20-Apr-20 10:20 PM, Prasanta Sadhukhan wrote:

On 20-Apr-20 10:16 PM, Sergey Bylokhov wrote:
On 4/20/20 8:34 am, Prasanta Sadhukhan wrote:

On 20-Apr-20 8:54 PM, Sergey Bylokhov wrote:
On 4/20/20 2:40 am, Prasanta Sadhukhan wrote:
http://cr.openjdk.java.net/~psadhukhan/8213535/webrev.4/

used the right GC for the tip but we still need the preferredSize in the paint()

Why do we need it? Do we calculate the size in the ToolTipManager.showTipWindow() incorrectly? We call tip.getPreferredSize() there,  does it return different result than in the paint() method?

No, there it returns the same value as paint() now after GC fix, but c.getSize() in paint() returns the JPanel size which is not same as preferredSize and it is not enough to contain the text, it seems.

But the panel and window both are created by our code in ToolTipManager.showTipWindow, should we adjust it?

But getPreferredSize() uses span calculation+6 which is not present in panel's setSize calculation. I would think using preferredSize is better than meddling with setSize calculation, given that TooltipManager.showTipWindow () also used getPreferredSize() to calculate the tip bounds.

It seems JPanel (component created for LW popup) GC is again null and not in sync with JToolTip's GC so in addition to fix JToolTip's GC, we also need to set GC of JPanel (jn sync with "contents" or tip's GC), so setSize() will be set same as preferredSize.

http://cr.openjdk.java.net/~psadhukhan/8213535/webrev.5/

Regards
Prasanta

Reply via email to