Documentation

The Java™ Tutorials

Trail: Creating a GUI With Swing使用Swing创建GUI

Also known as The Swing Tutorial也称为Swing教程

This trail tells you how to create graphical user interfaces (GUIs) for applications and applets, using the Swing components.本教程介绍如何使用Swing组件为应用程序和小程序创建图形用户界面(GUI)。If you would like to incorporate JavaFX into your Swing application, please see Integrating JavaFX into Swing Applications.如果您希望将JavaFX合并到Swing应用程序中,请参阅将JavaFX集成到Swing应用程序中

Getting Started with SwingSwing起步 is a quick start lesson.这是一堂快速入门课。First it gives you a bit of background about Swing. Then it tells you how to compile and run programs that use Swing components.首先,它提供了一些关于Swing的背景知识。然后它告诉您如何编译和运行使用Swing组件的程序。

Learning Swing with the NetBeans IDE使用NetBeans IDE学习Swing is the fastest and easiest way to begin working with Swing.是开始使用Swing的最快、最简单的方法。This lesson explores the NetBeans IDE's GUI builder, a powerful feature that lets you visually construct your Graphical User Interfaces.本课程探讨NetBeans IDE的GUI生成器,这是一个强大的功能,可以让您直观地构建图形用户界面。

Using Swing Components使用Swing组件 tells you how to use each of the Swing components — buttons, tables, text components, and all the rest.告诉您如何使用每个Swing组件:按钮、表格、文本组件以及所有其他组件。It also tells you how to use borders and icons.它还告诉您如何使用边框和图标。

Concurrency in SwingSwing中的并发 discusses concurrency as it applies to Swing programming.讨论应用于Swing编程的并发性。Information on the event dispatch thread and the SwingWorker class are included.其中包括有关事件分派线程和SwingWorker类的信息。

Using Other Swing Features使用其他Swing特性 tells you how to use actions, timers, and the system tray; how to integrate with the desktop class, how to support assistive technologies, how to print tables and text, how to create a splash screen, and how to use modality in dialogs.告诉您如何使用操作、计时器和系统托盘;如何与桌面类集成,如何支持辅助技术,如何打印表格和文本,如何创建初始屏幕,以及如何在对话框中使用模态。

Laying Out Components Within a Container在容器内布置组件 tells you how to choose a layout manager, how to use each of the layout manager classes the Java platform provides, how to use absolute positioning instead of a layout manager, and how to create your own layout manager.告诉您如何选择布局管理器,如何使用Java平台提供的每个布局管理器类,如何使用绝对定位代替布局管理器,以及如何创建自己的布局管理器。

Modifying the Look and Feel修改外观和感觉 tells you how to specify the look and feel of Swing components.告诉您如何指定Swing组件的外观。

Drag and Drop and Data Transfer拖放和数据传输 tells you what you need to know to implement data transfer in your application.告诉您在应用程序中实现数据传输所需的知识。

Writing Event Listeners编写事件侦听器 tells you how to handle events in your programs.告诉您如何处理程序中的事件。

Performing Custom Painting表演定制绘画 gives you information on painting your own Swing components.提供有关绘制自己的Swing组件的信息。It discusses painting issues specific to Swing components, provides an overview of painting concepts, and has examples of custom components that paint themselves.它讨论了特定于Swing组件的绘制问题,提供了绘制概念的概述,并提供了绘制自己的自定义组件的示例。

Other UI-Related Trails其他与用户界面相关的线索

Although this is the main trail for learning about GUIs, it isn't the only trail with UI-related information.尽管这是学习GUI的主要途径,但它并不是唯一一条与UI相关信息的途径。


Previous page: Beginning of Tutorial
Next page: Getting Started with Swing