javax.swing.JDialog.toFront()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中javax.swing.JDialog.toFront()方法的一些代码示例,展示了JDialog.toFront()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JDialog.toFront()方法的具体详情如下:
包路径:javax.swing.JDialog
类名称:JDialog
方法名:toFront

JDialog.toFront介绍

暂无

代码示例

代码示例来源:origin: xyz.cofe/docking-frames-core

public void toFront() {
  dialog.toFront();
}

代码示例来源:origin: antlr/antlrworks

public void bringToFront() {
  jDialog.toFront();
}

代码示例来源:origin: de.dfki.mary/marytts-transcription

public void run() {
    startUpHelpDialog.toFront();
    closeHelp.grabFocus();
  }
});

代码示例来源:origin: MinecraftForge/Installer

@Override
  public void run()
  {
    InstallerPanel.this.dialog.toFront();
    InstallerPanel.this.dialog.requestFocus();
  }
});

代码示例来源:origin: Baralga/baralga

private void showJPopupMenu(final MouseEvent e) {
  if (e.isPopupTrigger() && menu != null) {
    Dimension size = menu.getPreferredSize();
    dialog.setLocation(e.getX(), e.getY() - size.height);
    dialog.setVisible(true);
    menu.show(dialog.getContentPane(), 0, 0);
    // popup works only for focused windows
    dialog.toFront();
  }
}

代码示例来源:origin: org.jvnet.hudson.plugins.hudsontrayapp/client-jdk16

private void showJPopupMenu(MouseEvent e) {
  if (e.isPopupTrigger() && menu != null) {
    Dimension size = menu.getPreferredSize();
    dialog.setLocation(e.getX(), e.getY() - size.height);
    dialog.setVisible(true);
    menu.show(dialog.getContentPane(), 0, 0);
    // popup works only for focused windows
    dialog.toFront();
  }
}

代码示例来源:origin: stackoverflow.com

// Create dialog box
JDialog dialog = new JDialog(new JFrame(), "Saving...");

// IMPORTANT: setLocationRelativeTo(null) is called AFTER you setSize()
// otherwise, your dialog box will not be at the center of the screen!
dialog.setSize(200,200);
dialog.setLocationRelativeTo(null);
dialog.toFront(); // raise above other java windows
dialog.setVisible(true);

// Sleep for 2 seconds
try
{
 Thread.sleep(2000);
} catch (InterruptedException ex)
{
 Logger.getLogger(JavaDialogBox.class.getName()).log(Level.SEVERE, null, ex);
}

// Then "close" the dialog box
dialog.dispose();

代码示例来源:origin: freeplane/freeplane

public void startup(List<NodeModel> nodes) {
  if(dialog != null){
    dialog.toFront();
    return;
  }
  final DefaultTableModel model = createTableModel();
  fillTableModel(model, nodes);
  tableModel = model;
  initializeUI();
}

代码示例来源:origin: igniterealtime/Spark

dialog.toFront();
dialog.requestFocus();

代码示例来源:origin: freeplane/freeplane

public void startup(NodeFilter nodeFilter) {
  if(dialog != null){
    dialog.toFront();
    return;
  }
  final DefaultTableModel model = createTableModel();
  fillTableModel(model, nodeFilter);
  tableModel = model;
  initializeUI();
}

代码示例来源:origin: org.cytoscape/webservice-biomart-client-impl

@Override
  public void run(TaskMonitor taskMonitor) throws Exception {
    final LoadRepositoryResult result = loadTask.getResult();
    panel.initDataSources(result);
    logger.info("BioMart Client initialized.");
    ((JDialog)panel.getRootPane().getParent()).toFront();
  }
}

代码示例来源:origin: org.cytoscape/swing-application-impl

dialog.setVisible(true);
} else {
  dialog.toFront();

代码示例来源:origin: triplea-game/triplea

/**
 * Opens the settings Swing window.
 */
public void open() {
 Preconditions.checkState(SwingUtilities.isEventDispatchThread());
 if (dialog == null) {
  dialog = GameRunner.newDialog("Settings");
  dialog.setContentPane(newContentPane());
  dialog.setMinimumSize(new Dimension(400, 50));
  dialog.pack();
  dialog.setLocationRelativeTo(dialog.getOwner());
  dialog.setVisible(true);
  SwingComponents.addWindowClosingListener(dialog, this::close);
  SwingComponents.addEscapeKeyListener(dialog, this::close);
 } else {
  // window is already visible, bring it to the front
  dialog.toFront();
 }
}

代码示例来源:origin: notzippy/JALOPY2-MAIN

/**
 * {@inheritDoc} Overriden to dispatch the call to the top-level container if invoked
 * from the command line.
 */
public void toFront()
{
  Container c = getParent();
  if (c instanceof SettingsFrame)
  {
    ((SettingsFrame) c).toFront();
    c.requestFocus();
  }
  else
  {
    super.toFront();
  }
}

代码示例来源:origin: antlr/antlrworks

dialog.toFront();

代码示例来源:origin: org.cytoscape/vizmap-gui-impl

@Override
public void mouseClicked(MouseEvent ev) {
  // Open only one editor at a time.
  if (isEditorDialogActive) {
    // Bring it to the front
    if (currentDialog != null)
      currentDialog.toFront();
    return;
  }
  final JDialog editorDialog = new JDialog();
  initComponents(editorDialog);
  editorDialog.addWindowListener(new WindowAdapter() {
    @Override
    public void windowClosed(WindowEvent evt) {
      final Dimension size = editor.getSize();
      drawIcon(size.width, size.height, false);
      isEditorDialogActive = false;
    }
  });
  editorDialog.setTitle("Continuous Mapping Editor for " + mapping.getVisualProperty().getDisplayName());
  editorDialog.setLocationRelativeTo(editor);
  editorDialog.setModalityType(JDialog.DEFAULT_MODALITY_TYPE);
  editorDialog.setVisible(true);
  isEditorDialogActive = true;
  currentDialog = editorDialog;
}

代码示例来源:origin: net.sf.taverna.t2.ui-activities/apiconsumer-activity-ui

public void actionPerformed(ActionEvent e) {
    JDialog currentDialog = ActivityConfigurationAction.getDialog(getActivity());
    if (currentDialog != null) {
      currentDialog.toFront();
      return;
    }
    final ApiConsumerConfigView apiConfigView = new ApiConsumerConfigView((ApiConsumerActivity)getActivity());
    final ActivityConfigurationDialog<ApiConsumerActivity, ApiConsumerActivityConfigurationBean> dialog =
      new ActivityConfigurationDialog<ApiConsumerActivity, ApiConsumerActivityConfigurationBean> (getActivity(), apiConfigView);

    ActivityConfigurationAction.setDialog(getActivity(), dialog);    
    
  }
}

代码示例来源:origin: net.sf.taverna.t2.ui-activities/rshell-activity-ui

/**
 * Pops up a {@link JDialog} with the {@link RshellActivityConfigView} and
 * provides a way to re-config the {@link RshellActivity} when the user
 * clicks OK
 */
public void actionPerformed(ActionEvent e) {
  JDialog currentDialog = ActivityConfigurationAction.getDialog(getActivity());
  if (currentDialog != null) {
    currentDialog.toFront();
    return;
  }
  final ActivityConfigurationPanel<RshellActivity, RshellActivityConfigurationBean> rshellConfigView = new RshellActivityConfigView(
      (RshellActivity) getActivity());
  final ActivityConfigurationDialog<RshellActivity, RshellActivityConfigurationBean> dialog =
    new ActivityConfigurationDialog<RshellActivity, RshellActivityConfigurationBean> (getActivity(), rshellConfigView);
  ActivityConfigurationAction.setDialog(getActivity(), dialog);    
  
}

代码示例来源:origin: igniterealtime/Spark

dialog.toFront();
dialog.requestFocus();

代码示例来源:origin: datacleaner/DataCleaner

public static void showErrorMessage(final String shortMessage, final String detailedMessage,
    final Throwable exception) {
  final Throwable presentedException = ErrorUtils.unwrapForPresentation(exception);
  if (exception == null) {
    showErrorMessage(shortMessage, detailedMessage);
    return;
  }
  final String finalDetailedMessage = detailedMessage == null ? "" : detailedMessage;
  final String finalShortMessage = shortMessage == null ? "" : shortMessage;
  final ErrorInfo info = new ErrorInfo(finalShortMessage, finalDetailedMessage, null, "error", presentedException,
      ErrorLevel.SEVERE, null);
  final JXErrorPane errorPane = new JXErrorPane();
  errorPane.setErrorInfo(info);
  final JDialog dialog = JXErrorPane.createDialog(null, errorPane);
  centerOnScreen(dialog);
  JXErrorPane.setDefaultLocale(Locale.ENGLISH);
  dialog.setLocale(Locale.ENGLISH);
  dialog.setModal(true);
  dialog.setTitle(finalShortMessage);
  dialog.setVisible(true);
  dialog.toFront();
}

相关文章

JDialog类方法