java.awt.Window.getOwnerlessWindows()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(172)

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

Window.getOwnerlessWindows介绍

暂无

代码示例

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

function hidematlab()
%HIDEMATLAB Hide the main Matlab desktop window (HACK)

dtWin = desktopwindow();
if ~isempty(dtWin)
  dtWin.setVisible(0);
end

function out = desktopwindow()
%DESKTOPWINDOW Find the main Matlab desktop window (HACK)

wins = java.awt.Window.getOwnerlessWindows();
out = [];
for i = 1:numel(wins)
  if isa(wins(i), 'com.mathworks.mde.desk.MLMainFrame')
    out = wins(i);
    return;
  end
end

代码示例来源:origin: com.metsci.glimpse/glimpse-platform-fixes

private static Window findWindow( long hwnd )
{
  // A map would scale better as the number of windows increases ...
  // but that would require bookkeeping, and presumably there won't be
  // all that many top-level windows
  //
  for ( Window w : getOwnerlessWindows( ) )
  {
    Long h = getHwnd( w );
    if ( h != null && h == hwnd )
    {
      return w;
    }
  }
  return null;
}

代码示例来源:origin: joel-costigliola/assertj-swing

/**
 * Return all available root {@code Window}s. A root {@code Window} is one that has a {@code null} parent. Nominally
 * this means a list similar to that returned by {@code Frame.getFrames()}, but in the case of an {@code Applet} may
 * return a few dialogs as well.
 *
 * @return all available root {@code Window}s.
 */
@Nonnull
Collection<Window> rootWindows() {
 Set<Window> rootWindows = newLinkedHashSet();
 synchronized (lock) {
  rootWindows.addAll(windowEventQueueMapping.windows());
 }
 rootWindows.addAll(newArrayList(Frame.getFrames()));
 rootWindows.addAll(newArrayList(Window.getOwnerlessWindows()));
 return rootWindows;
}

相关文章

Window类方法