Class LineBreak<T extends LineBreak<T>>


public class LineBreak<T extends LineBreak<T>> extends Br<T>
Represents an HTML line break, extending the <br> element.

The LineBreak class is a convenience wrapper around the Br element, providing a more descriptive class name for inserting single line breaks in text content. It is a self-closing element that creates a visual line break without starting a new paragraph or block element.

Features:

  • Alternative, more descriptive name for the Br element
  • Creates a single line break in text flow
  • Self-closing element with no content
  • Useful for addresses, poems, and formatted text

Usage:


 // Create a line break
 LineBreak br = new LineBreak();

 // Use in text content
 P paragraph = new P();
 paragraph.addText("First line");
 paragraph.addElement(new LineBreak());
 paragraph.addText("Second line");

 // Format an address
 Div address = new Div();
 address.addText("123 Main Street");
 address.addElement(new LineBreak());
 address.addText("Anytown, ST 12345");
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • LineBreak

      public LineBreak()