Now we are ready to create the JFrame that will become our application frame.
现在已准备好创建即将成为应用程序框架的JFrame了。
Drag and drop it to a location outside the JFrame component in the visual editor.
然后把它拖放到可视化编辑器中J Frame组件之外的位置。
The output method only reports the specified component (often a JFrame, JDialog, or JPanel).
out put方法仅报告指定的组件(通常是J Frame、JDialog或JPanel)。
As you may know, you don't add things directly to a JFrame, but instead to its content panel.
您可能知道,并不直接向J Frame添加组件,而是将组件添加到它的内容面板。
Select the text JFrame in the visual editor window. In the editable text box that appears, enter MyBooks.
在可视化编辑器窗口中选择文本JFrame,并在弹出的可编辑文本框中,输入 MyBooks。
Typically, you would create a JPanel to contain your application's UI elements, then add this panel to a JFrame.
一般情况下,您将创建一个JPanel来包含应用程序的UI元素,然后将该面板添加到J Frame。
The interesting part of the example isn't the JFrame itself but how it handles the interaction with the system tray.
这个示例中有趣的部分不是 JFrame本向,而是它如何处理与系统托盘的交互。
One problem with this setup, however, is that it is global to the top-level component (typically a JFrame or a JDialog).
但是这种设置有一个问题,就是它对于顶级组件(通常是J Frame或JDialog)而言是全局的。
For example, the following code adds a WindowListener to the JFrame that requests focus for the JTextField when the window is activated.
例如,下列代码将WindowListener添加到J Frame,后者在窗口被激活时为JTextField请求焦点。
The constructor sets the visibility of the JFrame to true, which is not permitted by Swing when running in the application's main thread.
构造器将JFrame的可视度设置为true,当Swing运行在应用程序的主线程上是,这是不被允许的。
Typically, the top-most component (such as a JFrame) is used, but lower-level or dynamic components (such as a pop-up JDialog) can also be reported.
通常使用顶级的组件(如JFrame),但较低级别的或动态的组件(如弹出式JDialog)也可以被报告。
The second important attribute is the class of the control, because there may be many JFrame objects displayed, but probably only one labeled Place an Order. Continue with these steps.
第二重要的属性是控件的类,因为可能会显示出许多JFrame对象,但是可能只有一个的标签为Placean Order。
The second important attribute is the class of the control, because there may be many JFrame objects displayed, but probably only one labeled Place an Order. Continue with these steps.
第二重要的属性是控件的类,因为可能会显示出许多JFrame对象,但是可能只有一个的标签为Placean Order。
应用推荐