提交 2d2fc8ef 编写于 作者: S serb

8040630: Popup menus and tooltips flicker with previous popup contents when first shown

Reviewed-by: kizune, pbansal
上级 05d10a00
/*
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -25,10 +25,14 @@
package javax.swing;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.GraphicsEnvironment;
import java.awt.Window;
import sun.awt.ModalExclude;
import sun.awt.SunToolkit;
/**
* Popups are used to display a <code>Component</code> to the user, typically
......@@ -157,8 +161,8 @@ public class Popup {
if (c instanceof JWindow) {
JWindow component = (JWindow)getComponent();
component.setLocation(ownerX, ownerY);
// Sets the proper location, and resets internal state of the window
component.setBounds(ownerX, ownerY, 1, 1);
component.getContentPane().add(contents, BorderLayout.CENTER);
component.invalidate();
component.validate();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册