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

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

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

JDialog.setAlwaysOnTop介绍

暂无

代码示例

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

dialog.setAlwaysOnTop(true);
dialog.setVisible(true);
dialog.dispose();

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

dialog.setAlwaysOnTop(true);
dialog.setVisible(true);
dialog.dispose();

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

JDialog dialog = new JDialog ();
dialog.setModal (true);
dialog.setAlwaysOnTop (true);
dialog.setModalityType (ModalityType.APPLICATION_MODAL);

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

JOptionPane optionPane = new JOptionPane();
JDialog dialog = optionPane.createDialog("Title");
dialog.setAlwaysOnTop(alwaysOnTop);
dialog.setVisible(true);

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

class AlwaysOnTopFileChooser extends JFileChooser {
  protected JDialog createDialog(Component parent) throws HeadlessException {
    JDialog dialog = super.createDialog(parent);
    dialog.setAlwaysOnTop(true);
    return dialog;
  }
}

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

class MyFileChooser extends JFileChooser {
  protected JDialog createDialog(Component parent) throws HeadlessException {
    JDialog dialog = super.createDialog(parent);
    dialog.setAlwaysOnTop(true);
    return dialog;
  }
}

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

int result = new JFileChooser() {
 @Override
 protected JDialog createDialog( Component parent ) throws HeadlessException {
  JDialog jDialog = super.createDialog( parent );
  jDialog.setAlwaysOnTop( true );
  return jDialog;
 }
}.showOpenDialog( null );

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

JDialog dialog = new JOptionPane("ErrorMsg",JOptionPane.ERROR_MESSAGE,JOptionPane.DEFAULT_OPTION).createDialog(" Failure"); 
   dialog.setAlwaysOnTop(true);
   dialog.setVisible(true);
   dialog.dispose();

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

private static void showErrorPane(String message, String title) {
  JOptionPane pane = new JOptionPane(message, JOptionPane.ERROR_MESSAGE);
  JDialog dialog = pane.createDialog(title);
  dialog.setAlwaysOnTop(true);
  dialog.setVisible(true);
}

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

exm:- setWarningMsg("thank you for using java");

public static void setWarningMsg(String text){
  Toolkit.getDefaultToolkit().beep();
  JOptionPane optionPane = new JOptionPane(text,JOptionPane.WARNING_MESSAGE);
  JDialog dialog = optionPane.createDialog("Warning!");
  dialog.setAlwaysOnTop(true);
  dialog.setVisible(true);
}

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

JOptionPane optionPane = new JOptionPane("ErrorMsg", JOptionPane.ERROR_MESSAGE);    
JDialog dialog = optionPane.createDialog("Failure");
dialog.setAlwaysOnTop(true);
dialog.setVisible(true);

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

private static void checkForCompatibleJavaVersion() {
  if(JAVA_VERSION.startsWith("10.") || JAVA_VERSION.startsWith("10-")) {
    JOptionPane optionPane = new JOptionPane(
      "Freeplane is not compatible with java 10, exiting",
      JOptionPane.ERROR_MESSAGE);
    JDialog dialog = optionPane.createDialog("Incompatible JRE version");
    dialog.setAlwaysOnTop(true);
    dialog.setVisible(true);
    System.exit(0);
  }
}

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

EventQueue.invokeLater(new Runnable(){
           @Override
           public void run() {
          JOptionPane op = new JOptionPane("Hi..",JOptionPane.INFORMATION_MESSAGE);
          JDialog dialog = op.createDialog("Break");
          dialog.setAlwaysOnTop(true);
          dialog.setModal(true);
          dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);      
          dialog.setVisible(true);
           }
         });

代码示例来源:origin: Mine-and-blade-admin/Battlegear2

@Override
  protected JDialog createDialog(Component parent) throws HeadlessException {
    // intercept the dialog created by JFileChooser
    JDialog dialog = super.createDialog(parent);
    dialog.setModal(true); // set modality (or setModalityType)
    dialog.setAlwaysOnTop(true);
    return dialog;
  }
};

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

public static final void sysMessageBox( String msgTitle, String msgText )
{
  //JOptionPane.showMessageDialog( null, msgText, msgTitle, JOptionPane.PLAIN_MESSAGE );
  JOptionPane pane = new JOptionPane(msgText, JOptionPane.INFORMATION_MESSAGE);
  JDialog dialog = pane.createDialog(msgTitle);
  dialog.setModalityType(ModalityType.MODELESS);
  dialog.setAlwaysOnTop(true);
  dialog.setVisible(true);
}

代码示例来源:origin: FellowTraveler/otapij

@Override
public String GetPasswordImageFromUser(String string) {
  JDialog j = new GetPasswordImageDialog();
  j.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
  j.setAlwaysOnTop(true);
  j.setVisible(true);
  return GetPasswordImageDialog.GetPasswordImagePath();
}

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

JOptionPane optionPane = new JOptionPane(this,1,JOptionPane.PLAIN_MESSAGE);   
       optionPane.setOptions(new Object[]{});
       JDialog dialog = optionPane.createDialog(null, "Quick Help");
       dialog.setLocation(1000,10);
       dialog.setAlwaysOnTop(dialog.isAlwaysOnTopSupported());
       dialog.setVisible(true);

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

@Override
  public void run() {
    if (null != infoMsg && !infoMsg.isEmpty()){
      UsePinPadDialogController.this.dialog = new UsePinPadDialog(pinOp,pin.getLabel(), pin.getBackground(), locale, infoMsg);
    } else {
      UsePinPadDialogController.this.dialog = new UsePinPadDialogSmall(pinOp,pin.getLabel(), pin.getSmallBackground(), locale);
    }
    UsePinPadDialogController.this.dialog.setAlwaysOnTop(true);
    UsePinPadDialogController.this.dialog.setVisible(true);
    UsePinPadDialogController.this.dialog.requestFocusInWindow();
  }
});

代码示例来源:origin: MrCrayfish/ModelCreator

public static void show(JFrame parent)
{
  JPanel dialogContent = getDialogContent(parent);
  JDialog welcomeDialog = getWelcomeDialog(parent, dialogContent);
  welcomeDialog.requestFocus();
  welcomeDialog.setAlwaysOnTop(true);
  showDialog(welcomeDialog);
}

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

@Override
  public void run() {
    if (null != infoMsg && !infoMsg.isEmpty()){
      dialog = new VerifyPinDialog(pin.getLabel(), pin.getBackground(), pin.getMinLength(), pin.getMaxLength(), locale, VerifyPinDialogController.this.listener, infoMsg);
    } else {
      dialog = new VerifyPinDialogSmall(pin.getLabel(), pin.getSmallBackground(), pin.getMinLength(), pin.getMaxLength(), locale, VerifyPinDialogController.this.listener);
    }
    dialog.setAlwaysOnTop(true);
    dialog.setVisible(true);
    dialog.requestFocusInWindow();
  }
});

相关文章

JDialog类方法