本文整理汇总了Java中javax.swing.JDialog.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java JDialog.setVisible方法的具体用法?Java JDialog.setVisible怎么用?Java JDialog.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JDialog
的用法示例。
在下文中一共展示了JDialog.setVisible方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import javax.swing.JDialog; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
// FIXME: don't create a new one each time!
final File logfile = new File(Info.getHomeDir(), "errorLog");
final LogPane lp = new LogPane(logfile);
// FIXME: this should have its own key. Probably keys should be renamed
// to reflect what they are labeling, e.g., Help.show_error_log_menu_item,
// Help.error_log_dialog_title.
final JDialog d =
new JDialog(frame, Resources.getString("Help.error_log"));
d.setLayout(new MigLayout("insets 0"));
d.add(new JScrollPane(lp), "grow, push, w 500, h 600");
d.setLocationRelativeTo(frame);
d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
d.pack();
d.setVisible(true);
}
示例2: showProgress
import javax.swing.JDialog; //导入方法依赖的package包/类
public static ProgressDialog showProgress(Component parent, String message)
{
JDialog d = ComponentHelper.createJDialog(parent);
ProgressDialog p = new ProgressDialog(d);
d.getRootPane().setWindowDecorationStyle(JRootPane.INFORMATION_DIALOG);
d.setResizable(false);
d.setContentPane(p);
d.setTitle(message);
d.pack();
d.setLocationRelativeTo(parent);
d.setVisible(true);
return p;
}
示例3: showLicense
import javax.swing.JDialog; //导入方法依赖的package包/类
/**
* Brings up a dialog that displays the license.
*/
private void showLicense() {
JDialog dialog = new JDialog(this, resources.getString("dialog.license.title"));
final JEditorPane text = new JEditorPane();
try {
URL url = getClass().getResource("GNULicense.txt");
text.setPage(url);
} catch (Exception el) {
text.setText(resources.getString("dialog.license.error"));
}
text.setEditable(false);
JScrollPane sp = new JScrollPane(text);
sp.setPreferredSize(new Dimension(650, 500));
dialog.getContentPane().add(sp);
dialog.setLocation(getX() + getWidth() - 200, getY() + 50);
dialog.pack();
dialog.setVisible(true);
}
示例4: actionPerformed
import javax.swing.JDialog; //导入方法依赖的package包/类
final public void actionPerformed(ActionEvent objPactionEvent) {
final Object objLsourceObject = objPactionEvent.getSource();
if (objLsourceObject == this.objGpropertiesJButton) {
if (this.objGserviceUIFactory != null) {
final JDialog objLjDialog = (JDialog) this.objGserviceUIFactory.getUI(ServiceUIFactory.MAIN_UIROLE, ServiceUIFactory.JDIALOG_UI);
if (objLjDialog != null) {
objLjDialog.setVisible(true);
objLjDialog.dispose();
} else {
this.objGpropertiesJButton.setEnabled(false);
}
}
}
}
示例5: showUpgradeDialog
import javax.swing.JDialog; //导入方法依赖的package包/类
private static boolean showUpgradeDialog (final File source, String note) {
Util.setDefaultLookAndFeel();
JPanel panel = new JPanel(new BorderLayout());
panel.add(new AutoUpgradePanel (source.getAbsolutePath (), note), BorderLayout.CENTER);
JProgressBar progressBar = new JProgressBar(0, 100);
progressBar.setValue(0);
progressBar.setStringPainted(true);
progressBar.setIndeterminate(true);
panel.add(progressBar, BorderLayout.SOUTH);
progressBar.setVisible(false);
JButton bYES = new JButton("Yes");
bYES.setMnemonic(KeyEvent.VK_Y);
JButton bNO = new JButton("No");
bNO.setMnemonic(KeyEvent.VK_N);
JButton[] options = new JButton[] {bYES, bNO};
JOptionPane p = new JOptionPane (panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION, null, options, bYES);
JDialog d = Util.createJOptionProgressDialog(p, NbBundle.getMessage (AutoUpgrade.class, "MSG_Confirmation_Title"), source, progressBar);
d.setVisible (true);
return new Integer (JOptionPane.YES_OPTION).equals (p.getValue ());
}
示例6: CopyFiles
import javax.swing.JDialog; //导入方法依赖的package包/类
private CopyFiles(File source, File target, File patternsFile) {
this.sourceRoot = source;
this.targetRoot = target;
try {
InputStream is = new FileInputStream(patternsFile);
Reader reader = new InputStreamReader(is, "utf-8"); // NOI18N
readPatterns(reader);
reader.close();
} catch (IOException ex) {
// set these to null to stop further copying (see copyDeep method)
sourceRoot = null;
targetRoot = null;
LOGGER.log(Level.WARNING, "Import settings will not proceed: {0}", ex.getMessage());
// show error message and continue
JDialog dialog = Util.createJOptionDialog(new JOptionPane(ex, JOptionPane.ERROR_MESSAGE), "Import settings will not proceed");
dialog.setVisible(true);
return;
}
}
示例7: actionPerformed
import javax.swing.JDialog; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
if (!isEnabled())
return;
TermOptions clonedTermOptions = termOptions.makeCopy();
TermOptionsPanel subPanel = new TermOptionsPanel();
subPanel.setTermOptions(clonedTermOptions);
JOptionPane optionPane = new JOptionPane(subPanel,
JOptionPane.PLAIN_MESSAGE,
JOptionPane.OK_CANCEL_OPTION
);
JDialog dialog = optionPane.createDialog(Terminal.this,
"NBTerm Options");
dialog.setVisible(true); // WILL BLOCK!
if (optionPane.getValue() == null)
return; // was closed at the window level
switch ((Integer) optionPane.getValue()) {
case JOptionPane.OK_OPTION:
System.out.printf("Dialog returned OK\n");
termOptions.assign(clonedTermOptions);
applyTermOptions(false);
termOptions.storeTo(prefs);
break;
case JOptionPane.CANCEL_OPTION:
System.out.printf("Dialog returned CANCEL\n");
break;
case JOptionPane.CLOSED_OPTION:
System.out.printf("Dialog returned CLOSED\n");
break;
default:
System.out.printf("Dialog returned OTHER: %s\n",
optionPane.getValue());
break;
}
}
示例8: showSelectLanguageDialog
import javax.swing.JDialog; //导入方法依赖的package包/类
/**
* Method showSelectLanguageDialog
*/
private void showSelectLanguageDialog() {
// Don't show this dialog if DEFAULT_LOCALE is configured in the
// properties file.
if (checkConfigForDefaultLocale()) {
return;
}
JDialog selectLanguageDialog = new SelectLanguageDialog(frame, "Select Language");
selectLanguageDialog.setSize(240, 180);
selectLanguageDialog.setLocationRelativeTo(null);
selectLanguageDialog.setVisible(true);
}
示例9: showHelp
import javax.swing.JDialog; //导入方法依赖的package包/类
private void showHelp()
{
JDialog dialog = ComponentHelper.createJDialog(comp);
dialog.getContentPane().add(new HelpPanel(dialog, help));
dialog.setTitle(CurrentLocale.get("com.tle.admin.plugin.helplistener.title", title)); //$NON-NLS-1$
dialog.setSize(new Dimension(600, 400));
ComponentHelper.centreOnScreen(dialog);
dialog.setModal(true);
dialog.setVisible(true);
}
示例10: mapaLabelMouseClicked
import javax.swing.JDialog; //导入方法依赖的package包/类
private void mapaLabelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_mapaLabelMouseClicked
JDialog dialog = new JDialog();
dialog.setUndecorated(true);
JLabel label = new JLabel(imagemIcone);
dialog.setLocationRelativeTo(this);
dialog.setUndecorated(false);
dialog.add(label);
dialog.pack();
dialog.setVisible(true);
}
示例11: saveSEGY
import javax.swing.JDialog; //导入方法依赖的package包/类
private void saveSEGY(OutputStream out) throws IOException {
if(image==null) throw new IOException("no image loaded");
String mcsPath = PathUtil.getPath("PORTALS/MULTI_CHANNEL_PATH",
MapApp.BASE_URL+"/data/portals/mcs/");
URL url = URLFactory.url( mcsPath + line.getCruiseID().trim() + "/segy/" +
line.getCruiseID().trim() +"-"+
line.getID().trim() + ".segy" );
URLConnection urlCon = url.openConnection();
BufferedInputStream in = new BufferedInputStream(urlCon.getInputStream());
int length = urlCon.getContentLength();
// Create a JProgressBar + JDialog
JDialog d = new JDialog((Frame)null, "Saving SEGY");
JPanel p = new JPanel(new BorderLayout());
p.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
d.setLocationRelativeTo(null);
JProgressBar pb = new JProgressBar(0,length);
p.add(new JLabel("Saving " + (length / 1000000) + "mb segy file"), BorderLayout.NORTH);
p.add(pb);
d.getContentPane().add(p);
d.pack();
d.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
d.setVisible(true);
byte[] b = new byte[16384];
int read = in.read(b);
while (read != -1) {
out.write(b, 0, read);
pb.setValue(pb.getValue() + read);
pb.repaint();
read = in.read(b);
}
out.flush();
in.close();
d.dispose();
}
示例12: showmsg
import javax.swing.JDialog; //导入方法依赖的package包/类
/**
* Popup the given informative message, then ask the user to click Close to
* close it.
*/
public static void showmsg(String title, Object... msg) {
JButton dismiss = new JButton(Util.onMac() ? "Dismiss" : "Close");
Object[] objs = new Object[msg.length + 1];
System.arraycopy(msg, 0, objs, 0, msg.length);
objs[objs.length - 1] = OurUtil.makeH(null, dismiss, null);
JOptionPane about = new JOptionPane(objs, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null,
new Object[] {});
JDialog dialog = about.createDialog(null, title);
dismiss.addActionListener(Runner.createDispose(dialog));
dialog.setAlwaysOnTop(true);
dialog.setVisible(true);
dialog.dispose();
}
示例13: manageRefactorings
import javax.swing.JDialog; //导入方法依赖的package包/类
private synchronized void manageRefactorings(boolean single) {
HintsPanel panel;
if (single) {
panel = new HintsPanel((HintMetadata) singleRefactoringCombo.getSelectedItem(), null, cpBased);
} else {
panel = new HintsPanel((Configuration) configurationCombo.getSelectedItem(), cpBased);
}
DialogDescriptor descriptor = new DialogDescriptor(panel, NbBundle.getMessage(InspectAndRefactorPanel.class, "CTL_ManageRefactorings"), true, new Object[]{}, null, 0, null, null);
JDialog dialog = (JDialog) DialogDisplayer.getDefault().createDialog(descriptor);
dialog.validate();
dialog.pack();
dialog.setVisible(true);
if (panel.isConfirmed()) {
if (this.configurationRadio.isSelected()) {
Configuration selectedConfiguration = panel.getSelectedConfiguration();
if (selectedConfiguration != null) {
configurationCombo.setSelectedItem(selectedConfiguration);
}
} else {
HintMetadata selectedHint = panel.getSelectedHint();
if (selectedHint != null) {
if (panel.hasNewHints()) {
singleRefactoringCombo.setModel(new InspectionComboModel((allHints = Utilities.getBatchSupportedHints(cpBased)).keySet()));
}
singleRefactoringCombo.setSelectedItem(selectedHint);
}
}
}
}
示例14: botaoEntrarEmSalaKeyPressed
import javax.swing.JDialog; //导入方法依赖的package包/类
private void botaoEntrarEmSalaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_botaoEntrarEmSalaKeyPressed
if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) {
deslogar();
} else if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
JDialog tela = new TelaEntrarEmSala(this, true, this);
tela.setVisible(true);
}
}
示例15: showDialog
import javax.swing.JDialog; //导入方法依赖的package包/类
/** Shows the content of this table as a dialog. */
public void showDialog(Component parent, String title) {
JScrollPane scrollPane = new JScrollPane(this);
scrollPane.getViewport().setPreferredSize(getPreferredSize());
JOptionPane optionPane = new JOptionPane(scrollPane, JOptionPane.PLAIN_MESSAGE);
JDialog dialog = optionPane.createDialog(parent, title);
dialog.setVisible(true);
}