The object of JSeparator class is used to provide a general purpose component for implementing divider lines. It is used to draw a line to separate widgets in a Layout. It inherits JComponent class.
| Constructor | Description |
|---|---|
| JSeparator() | Creates a new horizontal separator. |
| JSeparator(int orientation) | Creates a new separator with the specified horizontal or vertical orientation. |
| Method | Description |
|---|---|
| void setOrientation(int orientation) | It is used to set the orientation of the separator. |
| int getOrientation() | It is used to return the orientation of the separator. |
Output:

Output:

We request you to subscribe our newsletter for upcoming updates.