javax.swing.JFrame.getIconImage()方法的使用及代码示例

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

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

JFrame.getIconImage介绍

暂无

代码示例

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

public void actionPerformed(ActionEvent e) {
 m_NotesButton.setEnabled(false);
 m_NotesFrame.setIconImage(((JFrame)SwingUtilities.getWindowAncestor(SimpleSetupPanel.this)).getIconImage());
 m_NotesFrame.setLocationRelativeTo(SwingUtilities.getWindowAncestor(SimpleSetupPanel.this));
 m_NotesFrame.setVisible(true);
}
 });

代码示例来源:origin: Waikato/weka-trunk

public void actionPerformed(ActionEvent e) {
 m_NotesButton.setEnabled(false);
 m_NotesFrame.setIconImage(((JFrame)SwingUtilities.getWindowAncestor(SimpleSetupPanel.this)).getIconImage());
 m_NotesFrame.setLocationRelativeTo(SwingUtilities.getWindowAncestor(SimpleSetupPanel.this));
 m_NotesFrame.setVisible(true);
}
 });

代码示例来源:origin: mguessan/davmail

public void run() {
    Image currentImage = mainFrame.getIconImage();
    if (currentImage != null && currentImage.equals(image)) {
      mainFrame.setIconImage(activeImage);
    } else {
      mainFrame.setIconImage(image);
    }
  }
});

代码示例来源:origin: com.fifesoft.rtext/fife.common

/**
 * Creates a frame to use for a floating dockable window.
 *
 * @param window The dockable window.
 * @return A frame in which to place the dockable window.
 */
private FloatingWindow createFloatingWindowFrame(DockableWindow window) {
  FloatingWindow temp = new FloatingWindow(window);
  Window parentWind = SwingUtilities.getWindowAncestor(this);
  if (parentWind instanceof JFrame) {
    temp.setIconImage(((JFrame)parentWind).getIconImage());
  }
  temp.pack();
  return temp;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf

/**
 * Gets the FrameIcon attribute of the SkinWindowWindow object
 * 
 * @return The FrameIcon value
 */
public Icon getFrameIcon() {
 Icon toreturn = null;
 Image frameImage = null;
 if (frame != null) {
  frameImage = frame.getIconImage();
 } else if (dialog != null) {
  // JDialog takes it from the parent frame
  Frame parent = (Frame)SwingUtilities.getAncestorOfClass(Frame.class,
    dialog);
  if (parent != null) {
   frameImage = parent.getIconImage();
  }
 }
 if (frameImage != null) {
  if (frameImage==cachedFrameImage) {
   return cachedFrameIcon;
  }
  toreturn = new ImageIcon(frameImage);
  cachedFrameImage = frameImage;
  cachedFrameIcon = toreturn;
 }
 return toreturn;
}

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

if (icon != null) {
 windowFrame.setIconImage(icon);
} else if (parentComponent != null && parentComponent.getIconImage() != null) {
 windowFrame.setIconImage(parentComponent.getIconImage());

代码示例来源:origin: cpesch/RouteConverter

public void run() throws HelpSetException, MalformedURLException {
    HelpBroker broker = Application.getInstance().getContext().getHelpBroker();
    CSH.DisplayHelpFromFocus helpFromFocus = new CSH.DisplayHelpFromFocus(broker);
    helpFromFocus.actionPerformed(getEvent());
    final Window window = ((DefaultHelpBroker) broker).getWindowPresentation().getHelpWindow();
    window.setIconImage(WindowHelper.getFrame().getIconImage());
    if (window instanceof JFrame) {
      JRootPane rootPane = ((JFrame) window).getRootPane();
      rootPane.registerKeyboardAction(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          window.setVisible(false);
        }
      }, getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    }
  }
}

相关文章

JFrame类方法