Table of Contents
首页 API Docs 工具
openjdk / 11.0.11 / java.desktop / javax / swing / swingcontainer.html /

Annotation Type SwingContainer

@Target(TYPE)
@Retention(RUNTIME)
public @interface SwingContainer

An annotation used to specify some swing-related information for the automatically generated BeanInfo classes. This annotation is not used if the annotated class has a corresponding user-defined BeanInfo class, which does not imply the automatic analysis.

The isContainer feature attribute was introduced primarily for the Swing library. All Swing components extend the Container class by design, so the builder tool assumes that all Swing components are containers. The BeanInfo classes with the isContainer attribute allow to directly specify whether a Swing component is a container or not.

Since:
9

Optional Elements

Modifier and Type Optional Element Description
String delegate

The name of the getter method in the annotated class, which returns the corresponding Swing container, if it is not recommended to add subcomponents to the annotated class directly.

boolean value

The value that indicates whether the annotated class can be used as a container for other Swing components or not.

Elements

value

boolean value

The value that indicates whether the annotated class can be used as a container for other Swing components or not.

Returns:
true if the annotated class is a Swing container; false otherwise.
Default:
true

delegate

String delegate

The name of the getter method in the annotated class, which returns the corresponding Swing container, if it is not recommended to add subcomponents to the annotated class directly.

Returns:
the name of the getter method in the annotated class, which returns the corresponding Swing container, or an empty string if the method name is not set.
Default:
""

© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/javax/swing/SwingContainer.html