Java Swing Tutorial - Java JSeparator(int orientation) Constructor








Syntax

JSeparator(int orientation) constructor from JSeparator has the following syntax.

public JSeparator(int orientation)

Example

In the following code shows how to use JSeparator.JSeparator(int orientation) constructor.

import javax.swing.JFrame;
import javax.swing.JSeparator;
/* w  w  w.ja v  a  2s .  c  om*/
public class Main {

  public static void main(String[] a){
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);


    frame.add(new JSeparator(JSeparator.VERTICAL));

    frame.setSize(300, 200);
    frame.setVisible(true);
  }


}