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

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

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

Window.getWindows介绍

暂无

代码示例

代码示例来源:origin: haraldk/TwelveMonkeys

@Override
  public void windowClosed(final WindowEvent e) {
    Window[] windows = Window.getWindows();
    if (windows == null || windows.length == 0) {
      System.exit(0);
    }
  }
}

代码示例来源:origin: com.github.lafa.twelvemonkeyspurejava.imageio/imageio-core

@Override
  public void windowClosed(final WindowEvent e) {
    Window[] windows = Window.getWindows();
    if (windows == null || windows.length == 0) {
      System.exit(0);
    }
  }
}

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

java.awt.Window win[] = java.awt.Window.getWindows();   
 for(int i=0;i<win.length;i++){   
   if (win[i].getName().equals("YourWindowName"))
    isOpen = true;
    break; 
 }

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

public Window getActiveWindow() {
  for (Window frame : Window.getWindows()) {
    if (frame.isActive()) {
      return frame;
    }
  }
  return this;
}

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

import java.awt.Window;
import javax.swing.JDialog;

public class Test {
  public static void main(String[] args) {
    JDialog d = new JDialog((Window)null,"Demo Dialog");
    for (Window w : JDialog.getWindows()) {
      if ( w instanceof JDialog) {
        System.out.println(((JDialog)w).getTitle());
      }
    }
  }
}

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

public boolean isAppActive() {
  for (Window frame : Window.getWindows()) {
    if (frame.isActive()) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: com.github.insubstantial/substance

@Override
  public void run() {
    for (Window window : Window.getWindows()) {
      SwingUtilities.updateComponentTreeUI(window);
    }
  }
});

代码示例来源:origin: org.java.net.substance/substance

public void run() {
    for (Window window : Window.getWindows()) {
      SwingUtilities.updateComponentTreeUI(window);
    }
  }
});

代码示例来源:origin: com.synaptix/SynaptixSwing

@Deprecated
public boolean isFrame() {
  Window[] ws = Window.getWindows();
  for (Window w : ws) {
    if (w.isActive()) {
      return w instanceof JFrame;
    }
  }
  throw new RuntimeException();
  // return displayStack.peek().getWindow() instanceof JFrame;
}

代码示例来源:origin: com.synaptix/SynaptixSwing

@Deprecated
public boolean isDialog() {
  Window[] ws = Window.getWindows();
  for (Window w : ws) {
    if (w.isActive()) {
      return w instanceof JDialog;
    }
  }
  throw new RuntimeException();
  // return displayStack.peek().getWindow() instanceof JDialog;
}

代码示例来源:origin: com.synaptix/SynaptixSwing

@Deprecated
public Window peek() {
  Window[] ws = Window.getWindows();
  for (Window w : ws) {
    if (w.isActive()) {
      return w;
    }
  }
  throw new RuntimeException();
  // return displayStack.peek().getWindow();
}

代码示例来源:origin: lbalazscs/Pixelitor

/**
 * @return true if any app window has focus
 */
public static boolean appHasFocus() {
  return Utils.anyMatch(Window.getWindows(), Window::isActive);
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

/**
   * Updates the componentTreeUI of all top-level windows of the 
   * current application.
   * 
   */
  public static void updateAllComponentTreeUIs() {
//        for (Frame frame : Frame.getFrames()) {
//            updateAllComponentTreeUIs(frame);
//        }
    // JW: updated to new 1.6 api - returns all windows, owned and ownerless
    for (Window window: Window.getWindows()) {
      SwingUtilities.updateComponentTreeUI(window);
    }
  }

代码示例来源:origin: org.jdesktop.bsaf/bsaf

/**
 * Return all of the visible JWindows, JDialogs, and JFrames per
 * Window.getWindows() on Java SE 6
 */
private List<Window> getVisibleSecondaryWindows() {
  List<Window> rv = new ArrayList<Window>();
  for (Window window : Window.getWindows()) {
    if (isVisibleWindow(window)) {
      rv.add(window);
    }
  }
  return rv;
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

/**
   * Updates the componentTreeUI of all top-level windows of the 
   * current application.
   * 
   */
  public static void updateAllComponentTreeUIs() {
//        for (Frame frame : Frame.getFrames()) {
//            updateAllComponentTreeUIs(frame);
//        }
    // JW: updated to new 1.6 api - returns all windows, owned and ownerless
    for (Window window: Window.getWindows()) {
      SwingUtilities.updateComponentTreeUI(window);
    }
  }

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

/**
   * Updates the componentTreeUI of all top-level windows of the 
   * current application.
   * 
   */
  public static void updateAllComponentTreeUIs() {
//        for (Frame frame : Frame.getFrames()) {
//            updateAllComponentTreeUIs(frame);
//        }
    // JW: updated to new 1.6 api - returns all windows, owned and ownerless
    for (Window window: Window.getWindows()) {
      SwingUtilities.updateComponentTreeUI(window);
    }
  }

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

public static void updateLookAndFeel() {
    for (Window w : Window.getWindows()) {
      if (w.isDisplayable()) {
        SwingUtilities.updateComponentTreeUI(w);
      }
    }
  }
}

代码示例来源:origin: JetBrains/jediterm

@NotNull
public static Window getActiveWindow() {
  Window[] windows = Window.getWindows();
  for (Window each : windows) {
    if (each.isVisible() && each.isActive()) return each;
  }
  return JOptionPane.getRootFrame();
}

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

private void replaceComponentText() {
  for (Window window : Window.getWindows()) {
    final Point mousePosition = window.getMousePosition(true);
    if (mousePosition != null) {
      final Component componentUnderMouse = SwingUtilities.getDeepestComponentAt(window, mousePosition.x,
        mousePosition.y);
      replaceComponentTexts(componentUnderMouse);
    }
  }
}

代码示例来源:origin: com.github.insubstantial/flamingo

private void repaintWindows() {
  for (Window window : Window.getWindows()) {
    window.repaint();
  }
  List<PopupInfo> popups = PopupPanelManager.defaultManager()
      .getShownPath();
  for (PopupPanelManager.PopupInfo popup : popups) {
    JPopupPanel popupPanel = popup.getPopupPanel();
    popupPanel.paintImmediately(new Rectangle(0, 0, popupPanel
        .getWidth(), popupPanel.getHeight()));
  }
}

相关文章

微信公众号

最新文章

更多

Window类方法