BEA Systems, Inc.

WebLogic Server 6.1 API Reference

Class CenteredElement


Deprecated. Use DivElement.setCentered()

public class CenteredElement
extends SinglePartElement

A CenteredElement centers an HtmlElement or a string in the center of the current line. It is a block-level element, that is, it introduces a new paragraph in versions of HTML after 2.0. (For older browsers, this may not be the case.)

Use a CenteredElement as the argument for any of the addElement() methods. You can also add centered elements with the asCenteredElement() method in the parent class HtmlElement.

Examples of adding CenteredElements to the body of an htmlKona page called "hp":

    hp.addElement(new CenteredElement("Today in the News"));
    hp.addElement(new StringElement(filename).asCenteredElement());

Prefer setting the ALIGN attribute to center for headings, divisions, and paragraphs. Some browsers do not support this tag.

The HTML CENTER element is deprecated in HTML 4.0 in favor of the DIV element with align set to "center". htmlKona will continue to support CenteredElement, but not all browsers may display this HTML element properly. Prefer DivElement.setCentered().

Copyright (c) 1995-1998 by WebLogic, Inc. All Rights Reserved., Copyright (c) 1998-1999 by BEA Systems, Inc. All Rights Reserved.
Copyright © 2001 BEA Systems, Inc. All Rights Reserved.
See Also:

Fields inherited from class weblogic.html.HtmlElement
codeset, useObsolete
Constructor Summary
          Deprecated. Constructs a CenteredElement.
CenteredElement(HtmlElement val)
          Deprecated. Constructs a CenteredElement with the specified HtmlElement.
CenteredElement(java.lang.String val)
          Deprecated. Constructs a CenteredElement with the specified string.
Method Summary
protected  java.lang.String getHtmlCode()
protected  boolean printCR()
Methods inherited from class weblogic.html.SinglePartElement
getElement, printBody, printBody, printBody, setElement, setElement, widthAsLiteral
Methods inherited from class weblogic.html.ElementWithAttributes
addAttribute, addAttribute, escapeQuotes, getBooleanAttribute, getElementAttribute, getLocalVar, getQuotedAttribute, output, output, output, printBody, printEndingTag, setBooleanAttribute, setBooleanAttribute, setClass, setDirection, setElementAttribute, setElementAttribute, setElementAttribute, setElementAttribute, setElementAttribute, setId, setLang, setLocalVar, setQuotedAttribute, setStyle
Methods inherited from class weblogic.html.HtmlElement
asAnchorElement, asBigElement, asBlockquoteElement, asBoldElement, asCenteredElement, asCiteElement, asCodeElement, asCommentElement, asDefineTermElement, asEmphasisElement, asFontElement, asFontElement, asFontElement, asHtmlContainer, asItalicElement, asKeyboardElement, asLiteralElement, asParagraphElement, asSampleElement, asSmallElement, asStrikeElement, asStrongElement, asSubscriptElement, asSuperscriptElement, asTeletypeElement, asUnderlineElement, asVariableElement, getVersion, setAnchorMode, setCodeset, toString, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public CenteredElement()
Constructs a CenteredElement.


public CenteredElement(java.lang.String val)
Constructs a CenteredElement with the specified string.

val - String


public CenteredElement(HtmlElement val)
Constructs a CenteredElement with the specified HtmlElement.

val - HtmlElement
Method Detail


protected java.lang.String getHtmlCode()

getHtmlCode in class ElementWithAttributes


protected boolean printCR()

printCR in class ElementWithAttributes

Documentation is available at

WebLogic classes and methods that do not appear in this reference are not public and are not supported.