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