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

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

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

Window.toBack介绍

[英]If this Window is visible, sends this Window to the back and may cause it to lose focus or activation if it is the focused or active Window.

Places this Window at the bottom of the stacking order and shows it behind any other Windows in this VM. No action will take place is this Window is not visible. Some platforms do not allow Windows which are owned by other Windows to appear below their owners. Every attempt will be made to move this Window as low as possible in the stacking order; however, developers should not assume that this method will move this Window below all other windows in every situation.

Because of variations in native windowing systems, no guarantees about changes to the focused and active Windows can be made. Developers must never assume that this Window is no longer the focused or active Window until this Window receives a WINDOW_LOST_FOCUS or WINDOW_DEACTIVATED event. On platforms where the top-most window is the focused window, this method will probably cause this Window to lose focus. In that case, the next highest, focusable Window in this VM will receive focus. On platforms where the stacking order does not typically affect the focused window, this method will probably leave the focused and active Windows unchanged.
[中]如果此窗口可见,则将此窗口发送到后面,如果它是聚焦或活动窗口,则可能会导致其失去焦点或激活。
将此窗口放置在堆叠顺序的底部,并将其显示在此VM中任何其他窗口的后面。如果此窗口不可见,则不会执行任何操作。一些平台不允许其他窗口拥有的窗口出现在其所有者的下方。将尽一切努力按照堆叠顺序将该窗口移动到尽可能低的位置;然而,开发人员不应该假设这种方法在任何情况下都会将此窗口移到所有其他窗口的下方。
由于本机窗口系统的变化,无法保证对聚焦窗口和活动窗口进行更改。在该窗口收到窗口失去焦点或窗口停用事件之前,开发人员决不能假定该窗口不再是焦点窗口或活动窗口。在最上面的窗口是聚焦窗口的平台上,这种方法可能会导致该窗口失去焦点。在这种情况下,这个VM中下一个最高的可聚焦窗口将接收焦点。在堆叠顺序通常不会影响聚焦窗口的平台上,此方法可能会保持聚焦窗口和活动窗口不变。

代码示例

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

@RunsInEDT
 private static void doMoveToBack(final @Nonnull Window w) {
  execute(() -> w.toBack());
 }
}

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

public static void backOtherWindows() {
  Component owner = getMenuComponent();
  if(owner instanceof Window){
    final Window[] ownedWindows = ((Window) owner).getOwnedWindows();
    for(Window w : ownedWindows){
      if(w.isVisible()){
        w.toBack();
      }
    }
  }
}

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

String s = e.getActionCommand();
if ("Back".equals(s)) {
  this.toBack();
} else if ("Front".equals(s)) {
  this.toFront();

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

for (Window w : ownedWindows) {
  if (w.isVisible()) {
    w.toBack();

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

toBack();

相关文章

Window类方法