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

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

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

JDialog.setIconImage介绍

暂无

代码示例

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

JFileChooser fc = new JFileChooser(new File("C:/")){
  @Override
  protected JDialog createDialog( Component parent ) throws HeadlessException {
    JDialog dialog = super.createDialog( parent );
    BufferedImage image = new BufferedImage( 16, 16, BufferedImage.TYPE_3BYTE_BGR );
    dialog.setIconImage( image );
    return dialog;
  }
};
fc.showOpenDialog(frame);

代码示例来源:origin: xXKeyleXx/MyPet

@Override
  protected JDialog createDialog(Component parent) throws HeadlessException {
    JDialog dialog = super.createDialog(parent);
    dialog.setIconImage(logoImage);
    return dialog;
  }
};

代码示例来源:origin: sc.fiji/TrackMate_

@Override
  protected JDialog createDialog( final Component lParent ) throws HeadlessException
  {
    final JDialog dialog = super.createDialog( lParent );
    dialog.setIconImage( TRACKMATE_ICON.getImage() );
    return dialog;
  }
};

代码示例来源:origin: es.gob.afirma/afirma-ui-core-jse

@Override
  protected JDialog createDialog(final Component p) {
    final JDialog dialog = super.createDialog(p);
    dialog.setIconImage((Image) icon);
    return dialog;
  }
};

代码示例来源:origin: fiji/TrackMate

@Override
  protected JDialog createDialog( final Component lParent ) throws HeadlessException {
    final JDialog dialog = super.createDialog( lParent );
    dialog.setIconImage( TRACKMATE_ICON.getImage() );
    return dialog;
  }
};

代码示例来源:origin: sc.fiji/TrackMate_

@Override
  protected JDialog createDialog( final Component lParent ) throws HeadlessException {
    final JDialog dialog = super.createDialog( lParent );
    dialog.setIconImage( TRACKMATE_ICON.getImage() );
    return dialog;
  }
};

代码示例来源:origin: sc.fiji/TrackMate_

@Override
  protected JDialog createDialog( final Component lParent ) throws HeadlessException {
    final JDialog dialog = super.createDialog( lParent );
    dialog.setIconImage( TRACKMATE_ICON.getImage() );
    return dialog;
  }
};

代码示例来源:origin: senbox-org/snap-desktop

private static void setIcon(final ModelessDialog dlg, final ImageIcon ico) {
    if (ico == null) return;
    dlg.getJDialog().setIconImage(ico.getImage());
  }
}

代码示例来源:origin: fiji/TrackMate

@Override
  protected JDialog createDialog( final Component lParent ) throws HeadlessException {
    final JDialog dialog = super.createDialog( lParent );
    dialog.setIconImage( TRACKMATE_ICON.getImage() );
    return dialog;
  }
};

代码示例来源:origin: fiji/TrackMate

@Override
  protected JDialog createDialog( final Component lParent ) throws HeadlessException
  {
    final JDialog dialog = super.createDialog( lParent );
    dialog.setIconImage( TRACKMATE_ICON.getImage() );
    return dialog;
  }
};

代码示例来源:origin: com.dorkbox/SystemTray

/**
 * Sets the image for the title-bar, so IF it shows in the task-bar, it will have the corresponding image as the SystemTray image
 */
public
void setTitleBarImage(final File imageFile) {
  if (this.iconFile == null || !this.iconFile.equals(imageFile)) {
    this.iconFile = imageFile;
    try {
      if (imageFile != null) {
        Image image = new ImageIcon(ImageIO.read(imageFile)).getImage();
        image.flush();
        // we set the dialog window to have the same icon as what is on the system tray
        hiddenDialog.setIconImage(image);
      }
    } catch (IOException e) {
      SystemTray.logger.error("Error setting the title-bar image for the popup menu task tray dialog");
    }
  }
}

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

final JDialog dlg = new JDialog();
dlg.setIconImage((new ImageIcon("C:/icon.jpg")).getImage());
dlg.setVisible(true);
System.out.println("Height = " + dlg.getIconImages().get(0).getHeight(null));
System.out.println("Width = " + dlg.getIconImages().get(0).getWidth(null));

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

JFrame dummyFrame = new MyJFrame();
 JDialog myDialog = new JDialog(dummyFrame, true);
 myDialog.setIconImage(dummyFrame.getIconImage()); // Not needed.
 myDialog.setFocusableWindowState(false);
 myDialog.setVisible(true);

代码示例来源:origin: org.japura/japura-gui

JDialog getModalDialog() {
 if (modalDialog == null) {
  modalDialog = new JDialog();
  ImageIcon ii = new ImageIcon(GUIImages.CALENDAR);
  modalDialog.setIconImage(ii.getImage());
  modalDialog.add(this);
  modalDialog.pack();
  modalDialog.setResizable(false);
  modalDialog.setModal(true);
 }
 return modalDialog;
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction
public void setIcon(ImageIcon aValue) {
  icon = aValue;
  if (surface instanceof JDialog) {
    ((JDialog) surface).setIconImage(icon != null ? icon.getImage() : null);
  }
  if (surface instanceof JInternalFrame) {
    ((JInternalFrame) surface).setFrameIcon(icon);
  }
  if (surface instanceof JFrame) {
    ((JFrame) surface).setIconImage(icon != null ? icon.getImage() : null);
  }
}

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

MyPanel panel = new MyPanel();
JDialog dialog = new JDialog();
dialog.add(panel);
dialog.setIconImage(...);
dialog.show();

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-widget

public void showInDialog(Frame ui, boolean undecorated) {
  JDialog f = new JDialog(ui, true);
  f.add(this);
  if (iconPath != null) {
    f.setIconImage(SwingUtil.createIcon(iconPath).getImage());
  }
  f.setResizable(false);
  f.setSize(550, 450);
  f.setUndecorated(undecorated);
  JRootPane rootPane = f.getRootPane();
  rootPane.setDefaultButton(close);
  rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "close");
  rootPane.getActionMap().put("close", closeAction);
  SwingUtil.center(ui, f);
  f.setVisible(true);
}

代码示例来源:origin: GoldenGnu/jeveassets

private void showImportTap() {
  cardLayout.show(jContent, AccountImportCard.SHARE_IMPORT.name());
  this.getDialog().setIconImage(Images.MISC_ESI.getImage());
  this.getDialog().setTitle(DialoguesAccount.get().dialogueNameAccountImport());
  jPrevious.setEnabled(false);
  jNext.setEnabled(true);
  jNext.setText(DialoguesAccount.get().nextArrow());
}

代码示例来源:origin: GoldenGnu/jeveassets

private void showTypeTap() {
  cardLayout.show(jContent, AccountImportCard.TYPE.name());
  this.getDialog().setIconImage(Images.EDIT_ADD.getImage());
  this.getDialog().setTitle(DialoguesAccount.get().dialogueNameAccountImport());
  jPrevious.setEnabled(false);
  jNext.setEnabled(false);
  jNext.setText(DialoguesAccount.get().nextArrow());
  focus();
}

代码示例来源:origin: GoldenGnu/jeveassets

private void showEveKitTap() {
  cardLayout.show(jContent, AccountImportCard.ADD_EVEKIT.name());
  this.getDialog().setIconImage(Images.MISC_EVEKIT.getImage());
  this.getDialog().setTitle(DialoguesAccount.get().dialogueNameAccountImport());
  jPrevious.setEnabled(enableTypeCard);
  jNext.setEnabled(true);
  jNext.setText(DialoguesAccount.get().nextArrow());
  focus();
}

相关文章

JDialog类方法