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


Java JDialog.isVisible方法代码示例

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


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

示例1: handleAbout

import javax.swing.JDialog; //导入方法依赖的package包/类
void handleAbout() {
    //#221571 - check if About window is showing already
    Window[] windows = Dialog.getWindows();
    if( null != windows ) {
        for( Window w : windows ) {
            if( w instanceof JDialog ) {
                JDialog dlg = (JDialog) w;
                if( Boolean.TRUE.equals(dlg.getRootPane().getClientProperty("nb.about.dialog") ) ) { //NOI18N
                    if( dlg.isVisible() ) {
                        dlg.toFront();
                        return;
                    }
                }
            }
        }
    }
    performAction("Help", "org.netbeans.core.actions.AboutAction"); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:NbApplicationAdapter.java

示例2: testDiffView

import javax.swing.JDialog; //导入方法依赖的package包/类
public void testDiffView () throws Throwable {
    // create a file and initial commit
    File file = new File(wc, "file.txt");
    file.createNewFile();

    // chain of change & commit
    StringBuilder content = new StringBuilder();
    for (int i = 1; i < 10; ++i) {
        for (int j = 1; j < 20; ++j) {
            content.append("File change number ").append(i).append("_").append(j).append("\n");
        }
        TestKit.write(file, content.toString());
        System.out.println("Commit nbr. " + i);
        TestKit.commit(wc);
    }

    // local changes
    // changes every few lines
    int pos = content.indexOf("\n");
    while (pos != -1) {
        int nextPos = content.indexOf("\n", pos + 30);
        if (nextPos == -1) {
            pos = -1;
        } else {
            String replaceString = "Local change \nLocal change \nLocal change \n";
            content.replace(pos + 1, nextPos, replaceString);
            pos = nextPos + nextPos - pos + replaceString.length();
            // every 5 next lines
            for (int i = 0; i < 5 && pos != -1; ++i) {
                pos = content.indexOf("\n", pos + 1);
            }
        }
    }
    TestKit.write(file, content.toString());

    boolean showing = SvnSearchHistorySupport.getInstance(file).searchHistory(100);
    assertTrue(showing);

    JDialog d = new JDialog((JFrame)null, "Close dialog");
    d.setModal(false);
    d.setVisible(true);
    while (d.isVisible()) {
        Thread.sleep(1000);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:46,代码来源:SearchHistoryTest.java

示例3: testDiffView

import javax.swing.JDialog; //导入方法依赖的package包/类
public void testDiffView () throws Throwable {
    // create a file and initial commit
    File file = new File(getWorkTreeDir(), "file.txt");
    file.createNewFile();

    // chain of change & commit
    StringBuilder content = new StringBuilder();
    for (int i = 1; i < 10; ++i) {
        for (int j = 1; j < 20; ++j) {
            content.append("File change number ").append(i).append("_").append(j).append("\n");
        }
        write(file, content.toString());
        System.out.println("Commit nbr. " + i);
        commit(wc);
    }

    // local changes
    // changes every few lines
    int pos = content.indexOf("\n");
    while (pos != -1) {
        int nextPos = content.indexOf("\n", pos + 30);
        if (nextPos == -1) {
            pos = -1;
        } else {
            String replaceString = "Local change \nLocal change \nLocal change \n";
            content.replace(pos + 1, nextPos, replaceString);
            pos = nextPos + nextPos - pos + replaceString.length();
            // every 5 next lines
            for (int i = 0; i < 5 && pos != -1; ++i) {
                pos = content.indexOf("\n", pos + 1);
            }
        }
    }
    write(file, content.toString());

    boolean showing = HgSearchHistorySupport.getInstance(file).searchHistory(100);
    assertTrue(showing);

    JDialog d = new JDialog((JFrame)null, "Close dialog");
    d.setModal(false);
    d.setVisible(true);
    while (d.isVisible()) {
        Thread.sleep(1000);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:46,代码来源:SearchHistoryTestCase.java


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