Java JSeparator

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.

JSeparator class declaration

public class JSeparator extends JComponent implements SwingConstants, Accessible

Commonly used Constructors of JSeparator

Constructor Description
JSeparator() Creates a new horizontal separator.
JSeparator(int orientation) Creates a new separator with the specified horizontal or vertical orientation.

Commonly used Methods of JSeparator

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.

Java JSeparator Example 1

Flash Soon


Output


Java JSeparator Example 2

Flash Soon


Output


Advertisement

© Sapster 2017