The Java Tutorials have been written for JDK 8.Java教程是为JDK 8编写的。Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.本页中描述的示例和实践没有利用后续版本中引入的改进,并且可能使用不再可用的技术。See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.有关Java SE 9及其后续版本中更新的语言特性的摘要,请参阅Java语言更改。
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.有关所有JDK版本的新功能、增强功能以及已删除或不推荐的选项的信息,请参阅JDK发行说明。
The second column in the table below has links to zip files for each demo that you can open and run in the NetBeans IDE. 下表中的第二列有指向每个演示的zip文件的链接,您可以在NetBeans IDE中打开并运行这些演示。Refer to Running Tutorial Examples in NetBeans IDE for more information.有关更多信息,请参阅在NetBeans IDE中运行教程示例。
If you download an individual example, take care to have all the necessary files in the proper hierarchy when you compile and run it. 如果您下载了一个单独的示例,那么在编译和运行它时,请注意将所有必要的文件都放在适当的层次结构中。All of the examples in the Swing tutorial are placed in a package. Swing教程中的所有示例都放在一个包中。For example, the components examples are placed in a 例如,组件示例放置在components
package. components
包中。See the following image for the complete structure. 有关完整结构,请参阅下图。Note that any examples using images expect their image files to be in a directory named 请注意,任何使用图像的示例都希望其图像文件位于名为images
that is in the same directory as the example's src files.images
的目录中,该目录与示例的src文件位于同一目录中。
Zip File |
||||
---|---|---|---|---|
HelloWorldSwing | Hello World Swing Project | HelloWorldSwing.java |
Compiling and Running Swing Programs |