javax.swing.JOptionPane.getFrameForComponent()方法的使用及代码示例

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

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

JOptionPane.getFrameForComponent介绍

暂无

代码示例

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

public BanPlayerAction(final Component parent, final IServerMessenger messenger) {
 super("Ban Player From Game");
 this.parent = JOptionPane.getFrameForComponent(parent);
 this.messenger = messenger;
}

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

public GetGameSaveClientAction(final Component parent, final IServerStartupRemote serverRemote) {
 super("Download Gamesave (Save Game)");
 this.parent = JOptionPane.getFrameForComponent(parent);
 this.serverRemote = serverRemote;
}

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

public BootPlayerAction(final Component parent, final IServerMessenger messenger) {
 super("Remove Player");
 this.parent = JOptionPane.getFrameForComponent(parent);
 this.messenger = messenger;
}

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

public ChangeGameOptionsClientAction(final Component parent, final IServerStartupRemote serverRemote) {
 super("Edit Game Options");
 this.parent = JOptionPane.getFrameForComponent(parent);
 this.serverRemote = serverRemote;
}

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

private boolean confirm(final String question) {
 final int selectionOption = JOptionPane.showConfirmDialog(JOptionPane.getFrameForComponent(this), question,
   "Question", JOptionPane.OK_CANCEL_OPTION);
 return selectionOption == JOptionPane.OK_OPTION;
}

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

public SetMapClientAction(final Component parent, final IClientMessenger clientMessenger,
  final List<String> availableGames) {
 super("Change Game To");
 this.parent = JOptionPane.getFrameForComponent(parent);
 this.clientMessenger = clientMessenger;
 this.availableGames = availableGames;
 Collections.sort(this.availableGames);
}

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

public void startEditing(){
  if(editBase == null){
    return;
  }
  final JFrame frame = (JFrame) JOptionPane.getFrameForComponent(AttributeTable.this);
  editBase.show(frame);
}

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

public ChangeToAutosaveClientAction(final Component parent, final IClientMessenger clientMessenger,
  final HeadlessAutoSaveType typeOfAutosave) {
 super("Change To " + typeOfAutosave.toString().toLowerCase());
 this.parent = JOptionPane.getFrameForComponent(parent);
 this.clientMessenger = clientMessenger;
 this.typeOfAutosave = typeOfAutosave;
}

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

public static Frame getFrame() {
  final Component currentRootComponent = getMenuComponent();
  return currentRootComponent instanceof Frame ? (Frame)currentRootComponent : JOptionPane.getFrameForComponent(currentRootComponent);
}

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

ReturnValue show(final Window parent) {
  dialog = new JDialog(JOptionPane.getFrameForComponent(parent), "Login", true);
  dialog.getContentPane().add(this);
  SwingComponents.addEscapeKeyListener(dialog, this::close);
  dialog.pack();
  dialog.setLocationRelativeTo(parent);
  dialog.setVisible(true);
  dialog.dispose();
  dialog = null;
  return returnValue;
 }
}

代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit

public void actionPerformed(ActionEvent evt)
  {
    if(evt.getSource() == ok)
      dispose();
    else if(evt.getSource() == pluginMgr)
    {
      PluginManager.showPluginManager(JOptionPane.getFrameForComponent(
        ErrorListDialog.this));
    }
  } //}}}
} //}}}

代码示例来源:origin: net.sf.taverna.t2.ui-impl/zaria

public static Artifact showDialog(Component frameComp,
    Component locationComp, String labelText, String title,
    String[] suggestedGroups, String[] suggestedVersions) {
  Frame frame = JOptionPane.getFrameForComponent(frameComp);
  dialog = new ArtifactDownloadDialog(frame, locationComp, labelText,
      title, suggestedGroups, suggestedVersions);
  dialog.setVisible(true);
  return artifact;
}

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

public VerifiedRandomNumbersDialog(final Component parent) {
 super(JOptionPane.getFrameForComponent(parent), "Verified Random Numbers", false);
 init();
 pack();
}

代码示例来源:origin: net.sf.sfac/sfac-core

private DateTimeChooser getChooser() {
  if ((chooser == null) && (browseButton != null)) {
    Frame f = JOptionPane.getFrameForComponent(browseButton);
    String title = LanguageSupport.getOptionalLocalizedString("CHOOSE_DATE", "Choose date");
    chooser = new DateTimeChooser(f, title, type == DateType.DATE_TIME);
  }
  return chooser;
}

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

boolean frameLayoutCompleted() {
  final Frame frame = JOptionPane.getFrameForComponent(this);
  final Insets frameInsets = frame.getInsets();
  final Component rootPane = frame.getComponent(0);
  final boolean frameLayoutCompleted = rootPane.getWidth() == frame.getWidth() - frameInsets.left - frameInsets.right
      && rootPane.getHeight() == frame.getHeight() - frameInsets.top - frameInsets.bottom;
  return frameLayoutCompleted;
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

public Dialog(Component parent, String title, JPanel panel) {
  super(JOptionPane.getFrameForComponent(parent), title);
  setModal(true);
  this.panel = panel;
  getContentPane().add(panel, BorderLayout.CENTER);
  getContentPane().add(createButtonPanel(), BorderLayout.SOUTH);
}

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

public ServerOptions(final Component owner, final String defaultName, final int defaultPort,
  final boolean showComment) {
 super(owner == null ? null : JOptionPane.getFrameForComponent(owner), "Server options", true);
 this.showComment = showComment;
 initComponents();
 layoutComponents();
 setupActions();
 nameField.setText(defaultName);
 portField.setValue(defaultPort);
 setWidgetActivation();
 pack();
}

代码示例来源:origin: net.sf.sfac/sfac-core

public ValidationDialog(Component parent, ValidationReport theReport) {
  super(JOptionPane.getFrameForComponent(parent));
  setModal(true);
  report = theReport;
  setTitle();
  buildGui();
  aborted = report.getGlobalValidationLevel() == Level.ERROR;
  setBounds(parent);
}

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

private void hostGame() {
 final ServerOptions options = new ServerOptions(JOptionPane.getFrameForComponent(this),
   messengers.getMessenger().getLocalNode().getName(), 3300, true);
 options.setLocationRelativeTo(JOptionPane.getFrameForComponent(this));
 options.setNameEditable(false);
 options.setVisible(true);
 if (!options.getOkPressed()) {
  return;
 }
 GameRunner.hostGame(options.getPort(), options.getName(), options.getComments(), options.getPassword(),
   messengers);
}

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

public void actionPerformed(final ActionEvent e) {
    if (!getPrintController().acquirePrinterJobAndPageFormat(false)) {
      return;
    }
    final Component mapView = Controller.getCurrentController().getMapViewManager().getMapViewComponent();
    final PreviewDialog previewDialog = new PreviewDialog(getPrintController(), TextUtils
      .getText("print_preview_title"), mapView);
    previewDialog.pack();
    previewDialog.setLocationRelativeTo(JOptionPane.getFrameForComponent(mapView));
    previewDialog.setVisible(true);
  }
}

相关文章