Class Div<T extends Div<T>>

Direct Known Subclasses:
AsyncPanel, Deck, Dialog, Dialog.Content, DropPanel, FilterableTree, HashNavComponent, LiveRegion, ModalPopup, ModalPopup.Content, Popup, Spinner, TreeGroup

public class Div<T extends Div<T>> extends StyledContainerElement<T>
Java representation of the HTML <div> element.

The Div class represents a generic container element used for grouping and styling content. It is one of the most commonly used HTML elements for creating layouts and organizing page structure.

Features:

  • Block-level container element
  • CSS styling support via CssStyle
  • Text content with optional styling
  • Can contain other elements

Usage:


 // Create empty div
 Div div = new Div();
 div.addElement(new Span("Content"));

 // Create div with text
 Div div = new Div("Hello World");

 // Create div with styled text
 CssStyle style = new CssStyle();
 style.setColor("blue");
 Div div = new Div("Styled Text", style);
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • invalid reference
    StyledElement
  • Span
  • Constructor Details

    • Div

      public Div()
      Constructs an empty <div> element.
    • Div

      public Div(String text)
      Constructs a <div> element with the specified text content.
      Parameters:
      text - the text content to display
    • Div

      public Div(String text, CssStyle style)
      Constructs a <div> element with styled text content.
      Parameters:
      text - the text content to display
      style - the CSS style to apply
    • Div

      public Div(String text, String style)
      Constructs a <div> element with text content and inline CSS.
      Parameters:
      text - the text content to display
      style - the inline CSS style string (e.g., "color: blue; font-size: 14px")