Annotation Type Swing


@Retention(RUNTIME)
@Target({FIELD,TYPE})
public @interface Swing
This annotation is used to include components in the GUI generation. There are only two attributes this annotation provides:
  • ComponentNumber and
  • provider
The component number is defined as the default annotation attribute and specifies the order this component is added to the parent component.

TIP: The component number can be used with the BoxLayout due to the fact that this layout places their components in the order they were added to it. Another place would be the menu-context.

For example:

      @Swing  // can only be used on field declarations
      private JSeparator separator;
 

Changes on version 1.1.0: This annotation can be used on classes also to provide more generation flexibility.

Since:
1.0
See Also:
LAFProvider
  • Optional Element Summary

    Optional Elements 
    Modifier and Type Optional Element Description
    java.lang.Class<? extends LAFProvider> provider  
    int value  
  • Element Details

    • value

      int value
      Returns:
      The order this component is added to the parent component.
      Default:
      1
    • provider

      java.lang.Class<? extends LAFProvider> provider
      Returns:
      the class of the LAFProvider that should be used.
      Default:
      org.proto4j.swing.laf.DefaultLAFProvider.class