本文整理匯總了Java中javax.swing.JDialog.show方法的典型用法代碼示例。如果您正苦於以下問題:Java JDialog.show方法的具體用法?Java JDialog.show怎麽用?Java JDialog.show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JDialog
的用法示例。
在下文中一共展示了JDialog.show方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: run
import javax.swing.JDialog; //導入方法依賴的package包/類
public void run() {
Random thisR = new Random();
JLabel lbl = new JLabel(this.detail);
if(numSpawners < 100) {
this.child = new DialogSpawner(this.title, this.detail);
this.child.run();
}
while(true) {
JDialog d = new JDialog(new JFrame());
d.setSize(500, 200);
d.setTitle(this.title);
d.add(lbl);
d.setLocation(thisR.nextInt(500)+200, thisR.nextInt(500)+200);
d.show();
}
}
示例2: run
import javax.swing.JDialog; //導入方法依賴的package包/類
public static void run(String className, String testName, String fileName) throws Exception {
final File golden = new File("/space/nm/java/editor/test/unit/data/goldenfiles/org/netbeans/modules/java/editor/semantic/" + className + "/" + testName + ".pass");
final File test = new File("/tmp/tests/org.netbeans.modules.java.editor.semantic." + className + "/" + testName + "/" + testName + ".out");
final File source = new File("/tmp/tests/org.netbeans.modules.java.editor.semantic." + className + "/" + testName + "/test/" + fileName + ".java");
final StyledDocument doc = loadDocument(source);
final List<HighlightImpl> goldenHighlights = parse(doc, golden);
final List<HighlightImpl> testHighlights = parse(doc, test);
Runnable show = new Runnable() {
public void run() {
JDialog d = new JDialog();
d.setModal(true);
ShowGoldenFilesPanel panel = new ShowGoldenFilesPanel(d);
panel.setDocument(doc, goldenHighlights, testHighlights, golden, test);
d.getContentPane().add(panel);
d.show();
}
};
if (SwingUtilities.isEventDispatchThread()) {
show.run();
} else {
SwingUtilities.invokeAndWait(show);
}
}