Java JSeparator

Java JSeparator

Java JSeparator
Java JSeparator  class is used to draw lines that are used to separate widgets in a layout.


How to declare  Java JSeparator

[public class JSeparator extends JComponent implements SwingConstants, Accessible
 
 
]

Used Java JSeparator

Below are some of the commonly used Java JSeparator classes.
  • JSeparator()-used to create a new horizontal JSeperator.
  • JSeparator(int orientation)-used to create a new JSeperator with certain orientation.i.e vertical and horizontal.

Java JSeparator used  methods

  • void setOrientation(int orient)-used to set orientation.
  • void getOrientation()-returns orientation of JSeparator.

JSeparator Example

[
import javax.swing.JFrame;
import javax.swing.JSeparator;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

public class JSeparatorExample  extends JFrame{

    JSeparatorExample()
    {
        super("JSeparator Example");
        JMenuBar bar=new JMenuBar();
        JMenu menu=new JMenu("New");
        JMenuItem file=new JMenuItem("File");
        JMenuItem save=new JMenuItem("Save");
        JMenuItem edit=new JMenuItem("Edit");

        menu.add(file);
        menu.addSeparator();
        menu.add(save);
        menu.addSeparator();
        menu.add(edit);
        bar.add(menu);
        setJMenuBar(bar);

        setSize(400,400);
        setLayout(null);
        setVisible(true);



    }
    public static void main(String args [])
    {
        new JSeparatorExample();
    }

}
]

Java JSeparator Example two

[
import javax.swing.JFrame;
import javax.swing.JSeparator;
import javax.swing.JLabel;
import java.awt.GridLayout;

public class JSeparatorExample  extends JFrame{

    JSeparatorExample()
    {
        super("JSeparator Example");

        setLayout(new GridLayout(0,1));

        JLabel label=new JLabel("Label that is above separator");
        add(label);
        JSeparator sep=new JSeparator();
        add(sep);
        JLabel label2=new JLabel("Below Separator");
        add(label2);


        setSize(400,400);

        setVisible(true);



    }
    public static void main(String args [])
    {
        new JSeparatorExample();
    }

}
]




COMMENTS

Name

android android Apps android emulators antivirus blogger bluestack Break Statement in Java constructors download downloader drivers emulators java java control statements java do-while loop java for loop java infinitive do-while loop java system methods java tutorials Java While Loop java.awt java.swing javalookandfeel javascript JButton JCheckBox JColorChooser JComboBox JDialog JFileChooser JFrame JLayeredPane JList JMenuBar joomla JOptionPane JPanel JPasswordField JPopupMenu JProgressBar JRadioButton JScrollBar JSlider JSpinner JTabbedPane JTable JTextArea JTextField JToolBar mysql php plugins Polymorphism setToolTiptext skype for windows software swing class themes Visual Studio Code WeChat whatsapp wordpress
false
ltr
item
Java Codes: Java JSeparator
Java JSeparator
Java JSeparator
https://1.bp.blogspot.com/-E4Uj0jGXgM0/WNObFic4LbI/AAAAAAAAHQA/8kBpaBLmjV4Ld5c7vltd2ibbJo0Il1jlwCLcB/s200/Java-JSeparator-example.PNG
https://1.bp.blogspot.com/-E4Uj0jGXgM0/WNObFic4LbI/AAAAAAAAHQA/8kBpaBLmjV4Ld5c7vltd2ibbJo0Il1jlwCLcB/s72-c/Java-JSeparator-example.PNG
Java Codes
http://www.download-all.net/2017/03/java-jseparator.html
http://www.download-all.net/
http://www.download-all.net/
http://www.download-all.net/2017/03/java-jseparator.html
true
7826648292785071009
UTF-8
Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy