javax.swing.JDesktopPane.setSelectedFrame()方法的使用及代码示例

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

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

JDesktopPane.setSelectedFrame介绍

暂无

代码示例

代码示例来源:origin: org.jclarion/clarion-runtime

@Override
public void internalFrameOpened(InternalFrameEvent e) {
  if (current!=null) {
    pane.setSelectedFrame(current);
  }
} } );

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public void deactivateFrame(JInternalFrame f) {
  JDesktopPane d = f.getDesktopPane();
  JInternalFrame currentlyActiveFrame =
      (d == null) ? null : d.getSelectedFrame();
  if (currentlyActiveFrame == f)
    d.setSelectedFrame(null);
}

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

frame.setVisible(true);
dp.setSelectedFrame(iFrame);

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public void activateFrame(JInternalFrame f) {
  Container p = f.getParent();
  JDesktopPane d = f.getDesktopPane();
  JInternalFrame currentlyActiveFrame = (d == null) ? null : d.getSelectedFrame();
  // fix for bug: 4162443
  if (p == null) {
    // If the frame is not in parent, its icon maybe, check it
    p = f.getDesktopIcon().getParent();
    if (p == null)
      return;
  }
  // we only need to keep track of the currentActive InternalFrame, if any
  if (currentlyActiveFrame == null) {
    if (d != null) {
      d.setSelectedFrame(f);
    }
  } else if (currentlyActiveFrame != f) {
    // if not the same frame as the current active
    // we deactivate the current
    if (currentlyActiveFrame.isSelected()) {
      try {
        currentlyActiveFrame.setSelected(false);
      }
      catch (PropertyVetoException e2) {
      }
    }
    d.setSelectedFrame(f);
  }
  f.moveToFront();
}

代码示例来源:origin: robo-code/robocode

/**
 * Event handler for the menu item
 * <p>
 * Brings the window to the front. This should be called for the "More
 * Windows..." Item, because it doesn't make itself its own ActionListener.
 * <p>
 * Note that e can be null, and this menu item might not be showing (if this
 * is called from the "More Windows" dialog).
 */
public void actionPerformed(ActionEvent e) {
  if (window.isIcon()) {
    try {
      window.setIcon(false);
    } catch (Throwable ignored) {}
  }
  if (window.getDesktopPane() != null) {
    window.getDesktopPane().setSelectedFrame(window);
  }
  window.toFront();
  window.grabFocus();
  try {
    window.setSelected(true);
  } catch (Throwable ignored) {}
}

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

getDesktopPane().setSelectedFrame(this);
System.out.println(getDesktopPane().getSelectedFrame());

相关文章