javax.swing

Class JSeparator

public class JSeparator extends JComponent implements SwingConstants, Accessible

The JSeparator. It is mostly used to divide/space out components.
Nested Class Summary
protected classJSeparator.AccessibleJSeparator
Provides the accessibility features for the JSeparator component.
Constructor Summary
JSeparator()
Creates a new horizontal JSeparator object.
JSeparator(int orientation)
Creates a new JSeparator object with the given orientation.
Method Summary
AccessibleContextgetAccessibleContext()
Returns the object that provides accessibility features for this JSeparator component.
intgetOrientation()
Returns the orientation of the JSeparator.
SeparatorUIgetUI()
Returns the UI delegate being used with the JSeparator.
StringgetUIClassID()
Returns the suffix ("SeparatorUI" in this case) used to determine the class name for a UI delegate that can provide the look and feel for a JSeparator.
protected StringparamString()
Returns an implementation-dependent string describing the attributes of this JSeparator.
voidsetOrientation(int orientation)
Sets the orientation for the JSeparator and sends a {@link PropertyChangeEvent} (with the property name orientation) to all registered listeners.
voidsetUI(SeparatorUI ui)
Sets the separator's UI delegate.
voidupdateUI()
Sets this separator's UI delegate to the default (obtained from the {@link UIManager}) for the current look and feel.

Constructor Detail

JSeparator

public JSeparator()
Creates a new horizontal JSeparator object.

JSeparator

public JSeparator(int orientation)
Creates a new JSeparator object with the given orientation.

Parameters: orientation the orientation (either {@link #HORIZONTAL} or {@link #VERTICAL}).

Throws: IllegalArgumentException if orientation is not one of the specified values.

Method Detail

getAccessibleContext

public AccessibleContext getAccessibleContext()
Returns the object that provides accessibility features for this JSeparator component.

Returns: The accessible context (an instance of {@link AccessibleJSeparator}).

getOrientation

public int getOrientation()
Returns the orientation of the JSeparator.

Returns: The orientation (one of {@link #HORIZONTAL} and {@link #VERTICAL}).

See Also: JSeparator

getUI

public SeparatorUI getUI()
Returns the UI delegate being used with the JSeparator.

Returns: The JSeparator's UI delegate.

getUIClassID

public String getUIClassID()
Returns the suffix ("SeparatorUI" in this case) used to determine the class name for a UI delegate that can provide the look and feel for a JSeparator.

Returns: "SeparatorUI".

paramString

protected String paramString()
Returns an implementation-dependent string describing the attributes of this JSeparator.

Returns: A string describing the attributes of this JSeparator (never null).

setOrientation

public void setOrientation(int orientation)
Sets the orientation for the JSeparator and sends a {@link PropertyChangeEvent} (with the property name orientation) to all registered listeners.

Parameters: orientation the orientation (either {@link #HORIZONTAL} or {@link #VERTICAL}).

Throws: IllegalArgumentException if orientation is not one of the specified values.

See Also: getOrientation

setUI

public void setUI(SeparatorUI ui)
Sets the separator's UI delegate.

Parameters: ui the UI delegate.

updateUI

public void updateUI()
Sets this separator's UI delegate to the default (obtained from the {@link UIManager}) for the current look and feel.