简体   繁体   English

NetBeans中的AWT和Swing组件

[英]AWT and Swing components in NetBeans

Scenario : In NetBeans, you create Swing components via drag & drop and customize some properties via the given GUI. 场景:在NetBeans中,您可以通过拖放操作创建Swing组件,并通过给定的GUI自定义一些属性。

Question : Later on, If you see the generated code of these components, either in source or by by right-clicking the component and selecting customize code , we can see that the property changes are implemented via AWT. 问题:稍后,如果您在source代码中看到这些组件的生成代码,或者通过右键单击组件并选择customize code ,我们可以看到属性更改是通过AWT实现的。 Why is this so? 为什么会这样?

As mentioned in Using Top-Level Containers , 使用顶级容器中所述

Each program that uses Swing components has at least one top-level container. 使用Swing组件的每个程序至少有一个顶级容器。 This top-level container is the root of a containment hierarchy — the hierarchy that contains all of the Swing components that appear inside the top-level container. 此顶级容器是包含层次结构的根 - 包含显示在顶级容器内的所有Swing组件的层次结构。

java.awt.Container , an AWT Componenet , is that container. java.awt.Container ,一个AWT Componenet ,就是那个容器。

Addendum: This overview suggests how pervasively the interface java.beans.PropertyChangeListener is used throughout AWT and Swing. 附录:本概述表明在整个AWT和Swing中, java.beans.PropertyChangeListener接口的使用范围是多么普遍。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM