當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。