JSeparator provides a general purpose component for
implementing divider lines - most commonly used as a divider
between menu items that breaks them up into logical groupings.
Instead of using JSeparator directly,
you can use the JMenu or JPopupMenu
addSeparator method to create and add a separator.
JSeparators may also be used elsewhere in a GUI
wherever a visual divider is useful.
For more information and examples see How to Use Menus, a section in The Java Tutorial.
Warning
Swing is not thread safe. For more information see Swing's Threading Policy.
Warning
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans package.
Please see java..
| Modifier and Type | Class and Description |
|---|---|
| protected class | JSeparator.
This class implements accessibility support for the
|
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | JSeparator(int
an integer specifying
orientation)SwingConstants.HORIZONTAL or
SwingConstants.VERTICALCreates a new separator with the specified horizontal or vertical orientation. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public AccessibleContext | Returns: an AccessibleJSeparator that serves as the AccessibleContext of this JSeparatorOverrides java. Implements javax. Gets the AccessibleContext associated with this JSeparator. |
| public int | Returns: The value of the orientation property, one of the following constants defined inSwingConstants:
VERTICAL, or
HORIZONTAL.Returns the orientation of this separator. |
| public SeparatorUI | Returns: the SeparatorUI object that renders this componentOverrides javax. Returns the L&F object that renders this component. |
| public String | Returns: the string "SeparatorUI"Overrides javax. Returns the name of the L&F class that renders this component. |
| protected String | Returns: a string representation of thisJSeparatorOverrides javax. Returns a string representation of this |
| public void | setOrientation(int
either orientation)SwingConstants.HORIZONTAL
or SwingConstants.VERTICALSets the orientation of the separator. |
| public void | |
| public void | updateUI()
Overrides javax. Resets the UI property to a value from the current look and feel. |
| private void | writeObject(ObjectOutputStream s)
Hides javax. See |
| orientation | back to summary |
|---|---|
| private int orientation | |
| uiClassID | back to summary |
|---|---|
| private static final String uiClassID Hides javax.
| |
| JSeparator | back to summary |
|---|---|
| public JSeparator() Creates a new horizontal separator. | |
| JSeparator | back to summary |
|---|---|
| public JSeparator(int orientation) Creates a new separator with the specified horizontal or vertical orientation.
| |
| checkOrientation | back to summary |
|---|---|
| private void checkOrientation(int orientation) | |
| getAccessibleContext | back to summary |
|---|---|
| public AccessibleContext getAccessibleContext() Overrides java. Implements javax. Gets the AccessibleContext associated with this JSeparator. For separators, the AccessibleContext takes the form of an AccessibleJSeparator. A new AccessibleJSeparator instance is created if necessary.
| |
| getOrientation | back to summary |
|---|---|
| public int getOrientation() Returns the orientation of this separator.
| |
| getUI | back to summary |
|---|---|
| public SeparatorUI getUI() Overrides javax. Returns the L&F object that renders this component.
| |
| getUIClassID | back to summary |
|---|---|
| public String getUIClassID() Overrides javax. Returns the name of the L&F class that renders this component.
| |
| paramString | back to summary |
|---|---|
| protected String paramString() Overrides javax. Returns a string representation of this
| |
| setOrientation | back to summary |
|---|---|
| public void setOrientation(int orientation) Sets the orientation of the separator. The default value of this property is HORIZONTAL.
| |
| setUI | back to summary |
|---|---|
| public void setUI(SeparatorUI ui) Sets the L&F object that renders this component.
| |
| updateUI | back to summary |
|---|---|
| public void updateUI() Overrides javax. Resets the UI property to a value from the current look and feel.
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream s) throws IOException Hides javax. See
| |
JSeparator class. It provides an implementation of the
Java Accessibility API appropriate to separator user-interface elements.Warning
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans package.
Please see java..
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public AccessibleRole | Returns: an instance of AccessibleRole describing the role of the objectOverrides javax. Get the role of this object. |
| AccessibleJSeparator | back to summary |
|---|---|
| protected AccessibleJSeparator() Constructs an | |
| getAccessibleRole | back to summary |
|---|---|
| public AccessibleRole getAccessibleRole() Overrides javax. Get the role of this object.
| |