本文整理汇总了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
}
示例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);
}
}
示例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);
}
}