setComponentZOrder

来源:互联网 发布:淘宝延长收货的时间 编辑:程序博客网 时间:2024/06/17 01:39

Moves the specified component to the specified z-order index in the container. The z-order determines the order that components are painted; the component with the highest z-order paints first and the component with the lowest z-order paints last. Where components overlap, the component with the lower z-order paints over the component with the higher z-order.
将指定的组件移动到容器中指定的z顺序索引。 z次序确定组件被绘制的顺序;首先绘制Z次序最高的组件,最后绘制Z次序最低的组件。 在组件重叠的地方,具有较低z阶的组件涂覆在具有较高z阶的组件上。
If the component is a child of some other container, it is removed from that container before being added to this container. The important difference between this method and java.awt.Container.add(Component, int) is that this method doesn’t call removeNotify on the component while removing it from its previous container unless necessary and when allowed by the underlying native windowing system. This way, if the component has the keyboard focus, it maintains the focus when moved to the new position.
如果组件是某个其他容器的子对象,则在添加到此容器之前将其从该容器中删除。 此方法与java.awt.Container.add(Component,int)之间的重要区别在于,该方法不会在组件上调用removeNotify,而是从其先前的容器中删除它,除非必要时,并且在底层本机窗口系统允许的情况下。 这样,如果组件具有键盘焦点,则在移动到新位置时会保持焦点。
This property is guaranteed to apply only to lightweight non-Container components. This method changes layout-related information, and therefore, invalidates the component hierarchy.

0 0