当前位置: 首页>>代码示例>>Java>>正文


Java Popup.hide方法代码示例

本文整理汇总了Java中javax.swing.Popup.hide方法的典型用法代码示例。如果您正苦于以下问题:Java Popup.hide方法的具体用法?Java Popup.hide怎么用?Java Popup.hide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.Popup的用法示例。


在下文中一共展示了Popup.hide方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hideCurrentPopup

import javax.swing.Popup; //导入方法依赖的package包/类
public void hideCurrentPopup() {
	Popup cur = curPopup;
	if (cur != null) {
		curPopup = null;
		dragStart = null;
		cur.hide();
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:9,代码来源:LayoutPopupManager.java

示例2: run

import javax.swing.Popup; //导入方法依赖的package包/类
private void run() {
    JPanel panel = new JPanel();

    int count = 0;
    long diffTime, initialDiffTime = 0;
    while (count < ITERATION_NUMBER) {
        robot.delay(ROBOT_DELAY);

        PopupFactory factory = PopupFactory.getSharedInstance();
        Popup popup = factory.getPopup(panel, textArea, editorPane.getLocation().x + 20,
                editorPane.getLocation().y + 20);

        long startTime = System.currentTimeMillis();
        popup.show();
        long endTime = System.currentTimeMillis();
        diffTime = endTime - startTime;

        if (count > 1) {
            if (diffTime * HANG_TIME_FACTOR < (endTime - startTime)) {
                throw new RuntimeException("The test is near to be hang: iteration count = " + count
                        + " initial time = " + initialDiffTime
                        + " current time = " + diffTime);
            }
        } else {
            initialDiffTime = diffTime;
        }
        count++;
        robot.delay(ROBOT_DELAY);

        popup.hide();
    }
}
 
开发者ID:JetBrains,项目名称:jdk8u_jdk,代码行数:33,代码来源:Popup401.java

示例3: show

import javax.swing.Popup; //导入方法依赖的package包/类
public void show() {

        Point xy = computeXY();

        Runnable runnable = new Runnable() {
            @Override
            public void run() {

                Popup popup = null;
                try {
                    Component useContents = contents;
                    if (opacity != null) {
                        JComponent tmp = new JComponent() {
                            @Override
                            protected void paintComponent(Graphics g) {
                                Graphics2D g2d = (Graphics2D) g;
                                AlphaComposite comp = AlphaComposite.getInstance(
                                        AlphaComposite.SRC_OVER, opacity);
                                Composite save = g2d.getComposite();
                                g2d.setComposite(comp);
                                super.paintComponent(g);
                                g2d.setComposite(save);
                            }
                        };
                        tmp.add(contents);
                        useContents = tmp;
                    }
                    popup = PopupFactory.getSharedInstance().getPopup(owner, useContents, xy.x, xy.y);
                    popup.show();
                    Thread.sleep(durationMillis);
                }
                catch (InterruptedException ignore) { }
                finally {
                    if (popup != null) {
                        popup.hide();
                    }
                }

            }
        };

        new Thread(runnable).start();
    }
 
开发者ID:kddart,项目名称:kdxplore,代码行数:44,代码来源:Toast.java


注:本文中的javax.swing.Popup.hide方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。