本文整理匯總了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);
}
}