<center>![A simple application with a frame that contains a menu bar and a content pane.](img/9027bf6c251e5585f58f479dee64b36d.jpg)</center>
![A simple application with a frame that contains a menu bar and a content pane.](img/9027bf6c251e5585f58f479dee64b36d.jpg)
|
<center>![A diagram of the frame's major parts](img/2f1684ebaf6a3a32a96240af3756984f.jpg)</center>
![A diagram of the frame's major parts](img/2f1684ebaf6a3a32a96240af3756984f.jpg)
**注意:** z 顺序决定了组件的绘制顺序。具有最高 z 次序涂料的组件首先涂漆,具有最低 z 次序涂料的组件最后涂漆。在组件重叠的情况下,具有较低 z 次序的组件在具有较高 z 次序的组件上绘制。 |
|
[组件 getComponentZOrder(组件 comp)](https://docs.oracle.com/javase/8/docs/api/java/awt/Container.html#getComponentZOrder-comp-) | 返回容器内组件的 z 顺序索引。组件在 z 顺序层次结构中越高,其索引越低。具有最低 z 顺序索引的组件最后绘制,高于所有其他子组件。 |
| | **注意:** z 顺序决定了组件的绘制顺序。具有最高 z 次序涂料的组件首先涂漆,具有最低 z 次序涂料的组件最后涂漆。在组件重叠的情况下,具有较低 z 次序的组件在具有较高 z 次序的组件上绘制。 |
| [组件 getComponentZOrder(组件 comp)](https://docs.oracle.com/javase/8/docs/api/java/awt/Container.html#getComponentZOrder-comp-) | 返回容器内组件的 z 顺序索引。组件在 z 顺序层次结构中越高,其索引越低。具有最低 z 顺序索引的组件最后绘制,高于所有其他子组件。 |
[Performing Custom Painting](../painting/index.html) for details)
[TitledBorder createTitledBorder(Border,String,int,int,字体,颜色)](https://docs.oracle.com/javase/8/docs/api/javax/swing/BorderFactory.html#createTitledBorder-javax.swing.border.Border-java.lang.String-int-int-java.awt.Font-java.awt.Color-) | Create a titled border. The string argument specifies the title to be displayed. The optional font and color arguments specify the font and color to be used for the title's text. The border argument specifies the border that should be displayed along with the title. If no border is specified, then a look-and-feel-specific default border is used.默认情况下,标题跨越其伴随边框的顶部并且左对齐。可选的整数参数按顺序指定标题的位置和对齐方式。 [`TitledBorder`](https://docs.oracle.com/javase/8/docs/api/javax/swing/border/TitledBorder.html) 定义了这些可能的位置:`ABOVE_TOP`,`TOP`(默认值),`BELOW_TOP`,`ABOVE_BOTTOM`,`BOTTOM`和`BELOW_BOTTOM`。您可以将对齐指定为`LEADING`(默认值),`CENTER`或`TRAILING`。在具有西方字母的区域设置中`LEADING`相当于`LEFT`,`TRAILING`相当于`RIGHT`。 |
* You can create a window with _uniform_ translucency, where each pixel has the same translucency (or alpha) value. The following screen capture shows a window with 45 percent translucency.
* You can create a window with _per-pixel_ translucency, where each pixel has its own alpha value. With this feature you can, for example, create a window that fades away to nothing by defining a gradient in the alpha values. The following screen capture shows a window with gradient translucency from the top (fully translucent) to the bottom (fully opaque).
<center>![A window with per-pixel translucency.](img/a7d78abb1444a94ae2a73d90bf467363.jpg)</center>
![A window with per-pixel translucency.](img/a7d78abb1444a94ae2a73d90bf467363.jpg)
* * *
...
...
@@ -43,7 +43,7 @@
* You can create a window with any `Shape` object that you can define. Shaped windows can be opaque, or they can use uniform, or per-pixel, translucency. The following screen capture shows an oval-shaped window with 30 percent translucency.
<center>[![Launches the ComponentEventDemo example](img/da4517ad7f535fc3704f4a24e3890554.jpg)](https://docs.oracle.com/javase/tutorialJWS/samples/uiswing/ComponentEventDemoProject/ComponentEventDemo.jnlp) </center>
[![Launches the ComponentEventDemo example](img/da4517ad7f535fc3704f4a24e3890554.jpg)](https://docs.oracle.com/javase/tutorialJWS/samples/uiswing/ComponentEventDemoProject/ComponentEventDemo.jnlp)